ThemeShaper Forums » Thematic

[closed]

Does query_posts or WP_Query conflict with is_child?

(2 posts)
  • Started 3 years ago by avalon54
  • Latest reply from avalon54
  • This topic is not resolved
  1. avalon54
    Member

    Hello, I'm using is_child() to display a menu for child pages that use a custom template based on Thematic page.php.

    is_child() works as expected using Thematic's "default" page template, or when using the custom page template without any modification.

    However, using query_posts to display posts from a given category for one of these child pages removes the menu?

    This is also the case when basing the template on Thematic's index.php.

    I may wind up using category page templates to do what I need to do but thought I'd seek a little advice on this point ;)

    Posted 3 years ago #
  2. avalon54
    Member

    Apparently the problem had to do with how I was using WP_Query.

    I needed to comment out //thematic_indexloop();, and replace it with something like the following:

    if(is_page(3)){
    $second_query = new WP_Query('cat=8');
    } else if (is_page(4)){
    $second_query = new WP_Query('cat=9');
    }

    // The Loop
    while( $second_query->have_posts() ) : $second_query->the_post();
    echo '

  3. ';
    the_title();
    echo '
  4. ';
    endwhile;

    wp_reset_postdata();

    ...hope that answers a question for someone.

Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.