Add Last Three Posts to the Navigation Menu as Dropdown In WordPress Using Thesis Theme

by Token Health on November 7, 2011 in Thesis

The Thesis user’s guide has an article titled “Add Recent Posts to Nav Menu as Dropdown” http://diythemes.com/thesis/rtfm/recent-posts-nav-menu-dropdown/.

On TokenHealth.com I have used this code with a slight modification to add the last 3 posts to the navigation menu at the top as a dropdown.

To accomplish a similar look on your WordPress blog with the Thesis theme add the following code to custom_functions.php

/* add last 3 posts to the nav menu */
function posts_nav() {
	echo '<li class="tab tab-recent"><a href="">Last 3 Posts</a><ul>';
	wp_get_archives('title_li=&type=postbypost&limit=3');
	echo '</ul></li>';
}
add_action('thesis_hook_last_nav_item','posts_nav');

Of course you can change this to your liking. Simply change the limit=3 to some other number such as 5. Then of course change the name from Last 3 Posts to whatever else you want. I think this a useful feature for site visitors although right now on this site’s design I think the name of these posts as in the boxes needs to be much wider.

What are your thoughts, do you think adding the last 3 posts or some other posts as a dropdown to the navigation menu is a useful feature?

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post:

  • Alternative Media
  • Blogging
  • Companies
  • Finance
  • Health
  • Other Bloggers
  • SEO
  • Thesis
  • Viral Videos