WordPress.org

Ready to get started?Download WordPress

Forums

Selecting one post, using meta (3 posts)

  1. neological
    Member
    Posted 5 years 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
    Member
    Posted 5 years 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
    Member
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic