Please Help in Displaying latest post

Discussion in 'WordPress' started by Rajnish357, Nov 11, 2011.

  1. #1
    I use this code to display latest post (only title) and it works fine but I want to display lastet post from each category, Please help me...
    <?php $recent = new WP_Query("cat=&showposts=12"); while($recent->have_posts()) : $recent->the_post();?>
    <div class="title">
    <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php $tit = the_title(); ?></a>
    </div>
    <?php endwhile; ?>
    PHP:

     
    Rajnish357, Nov 11, 2011 IP
  2. benny306

    benny306 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    51
    #2
    <?php $recent = new WP_Query("cat=&showposts=12"); while($recent->have_posts()) : $recent->the_post();?>

    change this to show whichever categories your want: The below code should show the first post from categories 1,2,3,4,5. just change the numbers to the correct category id you want to display.

    <?php $recent = new WP_Query("cat=1,2,3,4,5&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
     
    benny306, Nov 11, 2011 IP
  3. Rajnish357

    Rajnish357 Well-Known Member

    Messages:
    157
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    No I want to display according to last update post in the categories, like if category A has been updated after B the post of category A will come first and then post from category B... Like that
     
    Rajnish357, Nov 11, 2011 IP
  4. atnews

    atnews Peon

    Messages:
    277
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think its difficult because but you can hire php developer for this and ask him/her to develop a plugin.
     
    atnews, Nov 11, 2011 IP