WordPress.org

Support

Support » How-To and Troubleshooting » Selecting one post, using meta

Selecting one post, using meta

  • 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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->'); ?>

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Selecting one post, using meta’ is closed to new replies.