treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Analogue Magazine style tabel of contents in WordPress

  • Hi All,
    I am working on creating a table of contents for a paper magazine that is transitioning to web. What I want to do is use a page 'custom field' to modify the query_posts arg to focus on a single magazine issue category and then uses that query to call the three loops for the three base magazine categories and their children categories/posts.

    In Summary: Is there a way to get custom field meta out of a page and into query_posts?
    <?php query_posts('custom field value here');?>

  • Returns posts with custom fields matching both a key of 'color' AND a value of 'blue':
    query_posts('meta_key=color&meta_value=blue'); 

    Returns posts with a custom field key of 'color', regardless of the custom field value:
    query_posts('meta_key=color'); 

    Returns posts where the custom field value is 'color', regardless of the custom field key:
    query_posts('meta_value=color');
  • Thanks for the input Argeaux. For anyone else who is looking to do something similar.

    <?php query_posts('cat=(meta_value=issue_num),20&posts_per_page=-1');?>


    issue_num is the magazine issue number, 20 is catalogue number for featured articles.