query_posts – add class current Page – Child
-
I have a “navigation” with query_post and I want to add the class “current” when the child is the current page.
query_posts('post_type=page&post_parent=37&order=asc'); while (have_posts()) : the_post (); ?> <li ADD CLASS HERE id="post-<?php the_ID(); ?>" > <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <img src="IMAGE HERE" alt="" /> </li> <?php endwhile; wp_reset_query();
I didn’t do it with register_nav_menus because I need to custom it a little with images.
Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘query_posts – add class current Page – Child’ is closed to new replies.