• Either I’m an idiot or haven’t located exactly what I am looking for. I believe my issue is pretty simply, but I’m having no luck:

    I would like to display the 3 most recent post from my Blog category (cat=1)within the template for my homepage (home.php).

    How do I do this? And thanks in advance to anyone willing to help.

Viewing 1 replies (of 1 total)
  • <?php
    //display 3 post from category 109
       $args=array(
       'showposts'=>3,
       'category__in' => array(109),
       'caller_get_posts'=>1
       );
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <p><small><?php the_time('m.d.y') ?></small> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
    <?php
    the_content(); //use the_excerpt() for a summary
    ?>
    <?php
    //this is necessary to show the tags
    global $wp_query;
    $wp_query->in_the_loop = true;
    endwhile;
    }
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Show post from a specific category’ is closed to new replies.