WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #16967, comment 3


Ignore:
Timestamp:
03/26/2011 12:26:05 AM (7 years ago)
Author:
aaroncampbell
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16967, comment 3

    initial v1  
    33$my_query = new WP_Query('posts_per_page=10&orderby=date&order=DESC');
    44if ( $my_query->have_posts() ) {
    5                 echo "<h2>Without Cat=-###</h2>";
    6                 while ( $my_query->have_posts() ) {
    7                                 $p = $my_query->next_post();
    8                                 echo $p->post_date . " : " . $p->post_title . "<br />\r\n";
    9                 }
     5        echo "<h2>Without Cat=-###</h2>";
     6        while ( $my_query->have_posts() ) {
     7                $p = $my_query->next_post();
     8                echo $p->post_date . " : " . $p->post_title . "<br />\r\n";
     9        }
    1010}
    1111
    1212$my_query = new WP_Query('cat=-679&posts_per_page=10&orderby=date&order=DESC');
    1313if ( $my_query->have_posts() ) {
    14                 echo "<h2>With Cat=-### DESC</h2>";
    15                 while ( $my_query->have_posts() ) {
    16                                 $p = $my_query->next_post();
    17                                 echo $p->post_date . " : " . $p->post_title . "<br />\r\n";
    18                 }
     14        echo "<h2>With Cat=-### DESC</h2>";
     15        while ( $my_query->have_posts() ) {
     16                $p = $my_query->next_post();
     17                echo $p->post_date . " : " . $p->post_title . "<br />\r\n";
     18        }
    1919}
    2020
    2121$my_query = new WP_Query('cat=-679&posts_per_page=10&orderby=date&order=ASC');
    2222if ( $my_query->have_posts() ) {
    23                 echo "<h2>With Cat=-### ASC</h2>";
    24                 while ( $my_query->have_posts() ) {
    25                                 $p = $my_query->next_post();
    26                                 echo $p->post_date . " : " . $p->post_title . "<br />\r\n";
    27                 }
     23        echo "<h2>With Cat=-### ASC</h2>";
     24        while ( $my_query->have_posts() ) {
     25                $p = $my_query->next_post();
     26                echo $p->post_date . " : " . $p->post_title . "<br />\r\n";
     27        }
    2828}
    2929}}}