Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Page & Category Menu Bars »

Category menu to show the category posts in the dropdown

Old Jun 24, 2009, 01:02 AM
1 posts · Jun 2009
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.

<li class="Largenav"><h2><?php _e('Articles'); ?></h2>
<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; ?> 
Either where would I place this code in Atahualpa, or how else may I achieve the post–drop–down in this theme?
Old Aug 11, 2009, 06:26 AM
3 posts · Aug 2009
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.
Old Aug 11, 2009, 01:05 PM
Flynn's Avatar
3,768 posts · Oct 2008
Munich, Germany
Where exactly in the layout do you want to put that?
Old Aug 11, 2009, 07:25 PM
3 posts · Aug 2009
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
Old Aug 15, 2009, 10:52 AM
2 posts · Aug 2009
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... :-)
Old Aug 16, 2009, 04:42 AM
Flynn's Avatar
3,768 posts · Oct 2008
Munich, Germany
The code of gjchandler should work. I'd use it without the opening and closing <LI>'s

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; ?>

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/


category bar menu, category menu, category-page, dropdown menu, posts

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing category order in category menu bar, not in sidebar cat. list paulae Page & Category Menu Bars 13 Mar 30, 2011 05:36 PM
Show sticky posts in category pages c32v Atahualpa 3 Wordpress theme 3 Dec 12, 2010 08:37 AM
Show Child Category In Category Menu Bar? mwsmedia Page & Category Menu Bars 1 Jun 29, 2009 05:06 AM
[SOLVED] Category menu: show empty categories perdox808 Page & Category Menu Bars 2 Apr 8, 2009 09:59 PM
adding space between rotating header and category dropdown menu smkpbk Header configuration & styling 1 Feb 24, 2009 07:24 AM

All times are GMT -6. The time now is 03:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.