• oliverm

    (@oliverm)


    Hi,

    I’ve just deleted a line from a navbar template file in my WP that had a line that got all pages that had a customfield called sidebartext.

    I can’t find the page that I got that line from. Can someone help me?

    How can i use get_posts to get all pages with a custom field of a certain name ?

    Olly

Viewing 1 replies (of 1 total)
  • MichaelH

    (@michaelh)

    The template tag, query_posts() (or get_posts) can be used to do that:

    Returns posts with custom fields matching both a key of ‘color’ AND a value of ‘blue’:

    query_posts(‘meta_key=color&meta_value=blue’);

Viewing 1 replies (of 1 total)
  • The topic ‘get_posts and custom fields’ is closed to new replies.