Category menu to show the category posts in the dropdown
I would like to display the posts within specific categories in the category menu drop–down.
I've done something like this before in a different theme that was... well, more simple. My category "Articles" displayed the posts within that category on a drop–down menu. Code:
<li class="Largenav"><h2><?php _e('Articles'); ?></h2> |
I would *really* like to be able to do this also. Clicking on the category dropdown menu to go directly to the post will open up my comments section, so visitors won't have to click twice.
So far I haven't been able to figure out how to do this, so I hope Flynn can help. :) |
Where exactly in the layout do you want to put that?
|
Hi Flynn,
I can't speak for gjchandler, but I myself meant on the horizontal navigation menu at the top. So it's something like Category hover->dropdown action->Click to Individual posts within the Category |
Hi Flynn: I want to +1 this feature. I'd like to have the ability for readers to pick a specific post by category.
Optionally, a way to figure out how to conditionally display a sidebar widget depending on category ID would be great. That way, I could list posts by category on the sidebar of category pages, and that would work. (ps. I'm a fan and contributor... :-) |
The code of gjchandler should work. I'd use it without the opening and closing <LI>'s
<ul><?php global $post; $myposts = get_posts('numberposts=5&category=4'); foreach($myposts as $post) : ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> You can put this into the text areas in the theme options such as Style & edit HEADER AREA -> Configure Header Area To conditionally display widgets use the Widget Logic plugin http://wordpress.org/extend/plugins/widget-logic/ |
All times are GMT -6. The time now is 04:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.