loop causes page menu to not be active
-
Here is the default page loop:
<?php if(have_posts()) { /* Start the Loop */ while (have_posts()) { the_post(); get_template_part('content', 'page'); /* Display comments */ if ( theme_get_option('theme_allow_comments')) { comments_template(); } } } else { theme_404_content(); } ?>
When I modify it to this code below in a custom page template(to show a category of posts on a page), the menu item is not active anymore.
<?php if(have_posts()) { /* Start the Loop */ query_posts('cat=51'); while (have_posts()) { the_post(); get_template_part('content', 'post'); /* Display comments */ if ( theme_get_option('theme_allow_comments')) { comments_template(); } } } ?>
Is there something I can add to the custom page template or to the loop above to get the page menu item to remain active?
thanks,
John
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘loop causes page menu to not be active’ is closed to new replies.