Add tagged posts to wordpress page (6 posts)

  1. chris2006
    Posted 7 years ago #


    I'm currently creating a number of wordpress informational pages, and would like to attach a number of post entries at the bottom of the page.

    Is this possible?

    Ideally i would like to attach posts from specific tags, does anyone know of any plugins that would achieve this?


    Page about Blue Widgets
    blue widget information here etc

    Blue Widgets Are Fun And Cool
    New Blue Widgets Are Now Available

  2. taffeljohan
    Posted 7 years ago #

    I don't know of plugins for this, but it is pretty easy to put in a template, just by creating your own loop at the bottom. Something like this is all you need:

    $myTaggedPosts = new WP_Query();
    <?php while ($myTaggedPosts->have_posts()): $myTaggedPosts->the_post();?>
    <li><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
    <?php endwhile;?>
  3. chris2006
    Posted 7 years ago #

    That's a great help thanks taffeljohan!

    what would be a good solution to achieving this for multiple pages - with multiple tags?

    Using conditionals for the pageID?

  4. taffeljohan
    Posted 7 years ago #

    Sounds like a plan, if there aren't too many. Otherwise it will be a pain to hard code everything. Otherwise you could use custom fields on the pages to store parameters (tag names, for instance).

    By the way, it should have been
    (i left out the _posts part)

  5. taffeljohan
    Posted 7 years ago #

    I take back that last correction! There is no query_posts method in WP_Query. I was right the first time.

  6. gr33nturk
    Posted 7 years ago #

    Thanks. Ill give that a try at http://lime.wire-2008.com

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.