WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Showing Posts (2 posts)

  1. cregy
    Member
    Posted 7 years ago #

    Hi

    I am using Ryan Boren's plugin that creates a home page called Page to Front. I have also created a home.php template. This template displays the details of the home page across the top and in the right hand column the links list.

    Here's the problem! In the left hand column I want it to display the latest three posts from category no.1. I have used the following code:
    [h2]Recent Posts[/h2]
    [?php
    // I love WordPress so
    query_posts('showposts=1&cat=2');
    ?]
    [?php if (have_posts()) : while (have_posts()) : the_post(); ?]
    [li][a href="[?php the_permalink() ?]"][span class="date"][?php the_time('M.d') ?][/span] [?php the_title() ?] [/a][/li]
    [?php endwhile; endif; ?]
    (I have replaced the < with a [)

    But if you look at the front page of the site it is not actually displaying anything! Is this something to do with my code or the plugin please?

    Thanks

    Rich

  2. cregy
    Member
    Posted 7 years ago #

    Fixed it. Comes of working when I'm tired. The cat=2 should have been cat=1!

    Thanks

    Rich

Topic Closed

This topic has been closed to new replies.

About this Topic