• hi

    looking to use wp as a CMS

    site will have sections containing 3-4 common page templates

    code below lets me limit side navigation based on meta_key value
    <?php wp_list_pages(‘meta_key=section&title_li=<h2>Section Pages</h2>’ ); ?>

    how can I test for the meta_key value?

    thanks

    Mark

Viewing 1 replies (of 1 total)
  • Thread Starter nrrghh

    (@nrrghh)

    hi

    some progress

    discovered get_post_custom_keys

    code below gets the value of meta_key to then filter what Pages are shown in side nav

    I imagine this could be done in a slightly more elegant manner…

    <?php
    $custom_field_keys = get_post_custom_keys();
    foreach ( $custom_field_keys as $key => $value )
    if ($key < 1 ) $var = $value;
    wp_list_pages(“meta_key=$var&title_li=<h2>$var Pages</h2>” );
    ?>

    Mark

Viewing 1 replies (of 1 total)
  • The topic ‘Page Navigation: checking for value of meta_key’ is closed to new replies.