• Hi guys – I know there’s a way to do it but for the life of me I can’t remember where to look to find it. I have a “latest news” page. On it I would like to include posts only from the “latest news” posts. Help and thanks in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • La M

    (@lady_moocher)

    Well if you just apply the category of “news” to all those posts, then they will all be output on the archive page for that category.

    Thread Starter rigdonia

    (@rigdonia)

    🙂 Thanks – I know that seemed obvious. I am trying to get a page that looks something like this one. http://www.kristyvalshan.com/press-releases.html Maybe it will just be easier to add manually as we go along, but I also want to be able to have “Latest News” be listed at the top of my blog as a page….but when clicked, it goes to a condensed archive of that one category. Does that make sense? And do it automatically just to ease the process as we’ll have multiple people posting.

    La M

    (@lady_moocher)

    Well I’m no php expert, so I can’t guarantee this is right, but this is what I’d try to do:

    Create a new php template like this and call it rigdoniastemplate.php

    <?php

    /**

    * @package WordPress

    * @subpackage Default_Theme

    */

    ?>

    <div id=”news”>

    <h3>Latest news</h3>

    <?php

    $postslist = get_posts(‘numberposts=2&order=ASC&orderby=title&cat=6’);

    foreach ($postslist as $post) :

    setup_postdata($post);

    ?>

    <div>

    <h4><?php the_title(); ?></h4>

    <?php the_excerpt(); ?>

    </div>

    <?php endforeach; ?>

    </div>

    where cat=6 would be the id of your news category.

    Then when you’ve got it outputting the posts you like you need to import it into the right position in your main page’s php template.

    I’m not totally sure how you do this, but presumably in the same way you import headers and footers and sidebars.
    <?php get_rigdoniastemplate(); ?>

    As for it showing only condensed versions of posts, you mean it’s only displaying post excerpts rather than the full posts? I think you can change that in your settings.

    If not, take a look at the codex on <!–more–> tags. Or this plugin might help: http://sparepencil.com/code/advanced-excerpt/

    Hope that helps.

    La M

    (@lady_moocher)

    Of course you could just use this plugin:
    http://rmarsh.com/plugins/recent-posts/

    Thread Starter rigdonia

    (@rigdonia)

    🙂 Thanks I’ll play around with it! And I love a good plug in so I’ll check that out too!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘I want to show one category’s posts on it’s own page’ is closed to new replies.