Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

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


  #1  
Old Jun 24, 2009, 02:02 AM
gjchandler
 
1 posts · Jun 2009
Minnesota
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>
<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></li>
Either where would I place this code in Atahualpa, or how else may I achieve the post–drop–down in this theme?
  #2  
Old Aug 11, 2009, 07:26 AM
sam1327
 
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.
  #3  
Old Aug 11, 2009, 02:05 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Where exactly in the layout do you want to put that?
  #4  
Old Aug 11, 2009, 08:25 PM
sam1327
 
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
  #5  
Old Aug 15, 2009, 11:52 AM
Prose
 
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... :-)
  #6  
Old Aug 16, 2009, 05:42 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
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/

Bookmarks

Tags
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 06:36 PM
Show sticky posts in category pages c32v Atahualpa 3 Wordpress theme 3 Dec 12, 2010 09:37 AM
Show Child Category In Category Menu Bar? mwsmedia Page & Category Menu Bars 1 Jun 29, 2009 06:06 AM
[SOLVED] Category menu: show empty categories perdox808 Page & Category Menu Bars 2 Apr 8, 2009 10:59 PM
adding space between rotating header and category dropdown menu smkpbk Header configuration & styling 1 Feb 24, 2009 08:24 AM


All times are GMT -6. The time now is 12:53 AM.


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