Forums

Selecting one post, using meta (3 posts)

  1. neological
    Member
    Posted 10 months ago #

    Hey,

    I need to select one post from the main post database, if it has custom meta.

    In my case the meta would be "showcase" as it would appear above the other posts in a specified div.

    Please help: example url - http://www.pureelite.co.uk

  2. MichaelH
    moderator
    Posted 10 months ago #

    The template tag, query_posts(), has the "Custom field parameters" meta_key= and meta_value=.

    Example:
    <?php query_posts ('meta_key=cf1&meta_value=cf1 value here->'); ?>

    or
    <?php query_posts ('meta_key=cf1'); ?>

    or
    <?php query_posts ('meta_value=cf1 value here->'); ?>

  3. MichaelH
    moderator
    Posted 10 months ago #

    Oops, may need the 'showposts=1' parameter there also.

Reply

You must log in to post.

About this Topic