benjaminmorgan Posted December 19, 2011 Report Share Posted December 19, 2011 I wanted to be able to display only the 2nd level of a navigation menu on the sidebar as the client wished but I found this not easy. I think I should be able to do this with posts if I can get them going in ASC order by date created. here is my sidebar code. If there is anything wrong please tell me. Thanks!!! <div class="sidebar"> <?php if(trim(wp_title('', false))=="Commercial") { ?> <ul class="comside"> <?php ?> </ul> <?php }?> <ul class="comside"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php $recent_posts = wp_get_recent_posts(); foreach($recent_posts as $recent){ echo '<li><a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"].'</a></li> '; }?> <?php endwhile; ?> <?php endif; ?> </ul> </div> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.