Forums

Pull posts by cat and tag underneath page content (1 post)

  1. whizzybizzy
    Member
    Posted 1 month ago #

    I've been trying to figure what code I need to do the following:

    We have a page for each town with the content for the page displayed.

    Underneath that content, I want to display eg the last 5 posts in a particular category and which have a tag which matches the value of a custom field.

    This is the essence of my query:

    query_posts('cat=14&showposts=5&tag=<?php $key="area"; echo get_post_meta($post->ID, $key, true); ?>');

    But I'm no hardcore programmer so I would really appreciate if someone could point me in the right direction for the rest of it.

    I'll probably want to list either the first 5 posts, or the permalinks to the posts if there are more than 5.

    Can anyone please assist me?

    Many thanks.

Reply

You must log in to post.

About this Topic