• Resolved mjoanisse

    (@mjoanisse)


    Hi there,
    I have the following code:

    <?php
    if (is_page(40) || $post->post_parent == '40' || in_category('3')) {
    echo '<ul class="subnav">';
    wp_list_pages('title_li=&child_of=54&sort_column=menu_order');
    echo '</ul>';
    } //end ?>

    Problem ?

    The page with id ’40’ (as specified) – only displays the list when I add the ‘in_category(‘3’) … why is that?

    If i simply put

    <?php
    if (is_page(40)) {
    echo '<ul class="subnav">';
    wp_list_pages('title_li=&child_of=54&sort_column=menu_order');
    echo '</ul>';
    } //end ?>

    the list will not display itself on page…

    Any help / insight is well appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mjoanisse

    (@mjoanisse)

    also, if it’s worth mentioning. (which it probably is) –

    The page with id ’40’, has a custom query_posts, with pagination enabled.

    more important: where do you use the code?

    if you use it after your custom query, the original query_string is likely to be messed up;

    try wp_reset_query(); before your if statement (unless it is within your custom loop, then report back).

    Thread Starter mjoanisse

    (@mjoanisse)

    ahhh, that is great!

    I was trying to add it after a custom query (in a sidebar) – If possible can you give a little more description on the topic?

    i’d tried ‘reset_query();‘ but i suppose this only applies to the loop?

    Thanks again.
    Michael

    Thread Starter mjoanisse

    (@mjoanisse)

    *sorry, i’d tried rewing_query();.

    Thank you for the article reference –
    cheers

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_list_pages’ is closed to new replies.