The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Adding recent posts in footer (2 posts)

  1. taddmencer
    Posted 8 years ago #

    This is driving me mad. I've been working on this all day - pulling things from the codex left and right and for crying out loud .. I can't get it.

    Basically, I have two categories. One for the company news and one for articles. What I'm TRYING to do is have three columns in the footer. The first column will pull the last five posts to the 'news' category (id 1) the second column will pull the last fix posts from the 'dev.news' category (id 3 [no idea why 3, but hey ...]) and the last column is just a log in for a 3rd party tool we use.

    The problem I'm having is .. well, it just won't work! I can get it to pull news, but both columns pull the same news. The second column will drop the date.

    NO idea what I'm doing wrong. Probably just because I'm using the same coding for both columns but I have no clue what do to get this to work.

    Here is my code:

     $postslist = get_posts('numberposts=5&order=ASC&orderby=post_title&in_category=1');
     foreach ($postslist as $post) :
     <?php the_date(); ?>
     <br />
     <?php the_title(); ?>
     <?php endforeach; ?>

    The other will have in_category=3 naturally. But then drop out the_date() information.

    Any help and ideas are GREATLY appreciated!

  2. taddmencer
    Posted 8 years ago #

    ok - went the plugin route.


    This does the trick.

Topic Closed

This topic has been closed to new replies.

About this Topic