- This topic has 5 replies, 2 voices, and was last updated 15 years, 11 months ago by imported_Ryan.
-
AuthorPosts
-
April 23, 2008 at 10:58 am #46AnonymousMember
Hey great plugin Ryan. How can I limit the number of levels that pop out. ie. I have a page structure that is 3 levels deep but I don’t want to show the 3rd level in the drop down hover. I’m sure its pretty easy but I don’t want to mess with what I have without doing it properly. thanks in advance, cheers.
April 23, 2008 at 11:00 am #2160imported_RyanMemberI know how to do this for pages, but not for categories, archives etc. You will need to use one of the sets of code below instead of the regular function in your theme to limit the level of dropdown displayed.
Add &depth=x where x is the level of dropdown you want to appear for any page lists, ie: to display up to only the second level …
[code:3b2qg2qy]<?php wp_list_pages(‘title_li=&depth=2’); ?>[/code:3b2qg2qy]suckerfish()
[code:3b2qg2qy]<?php echo ‘
<ul id="suckerfishnav">
<li><a href="’ , bloginfo(‘url’) , ‘/">Home</a></li>
<li><a href="#">Pages</a>
<ul>’ , wp_list_pages(‘title_li=’) , ‘</ul>
</li>
<li><a href="#">Archives</a>
<ul>’ , wp_get_archives() , ‘</ul>
</li>
<li><a href="#">Categories</a>
<ul>’ , wp_list_categories(‘title_li=&exclude=10’) , ‘</ul>
</li>
<li><a href="#">Blogroll</a>
<ul>’ , wp_list_bookmarks(‘title_li=&categorize=0’) , ‘</ul>
</li>
</ul>’;
?>[/code:3b2qg2qy]suckerfish1()
[code:3b2qg2qy]<?php echo ‘
<ul id="suckerfishnav">’ , wp_list_pages(‘title_li=’) , ‘</ul>’;
?>[/code:3b2qg2qy]suckerfish2()
[code:3b2qg2qy]<?php echo ‘
<ul id="suckerfishnav">
<li><a href="’ , bloginfo(‘url’) , ‘/">Home</a></li>
‘ , wp_list_pages(‘title_li=’) , ‘
</ul>’;
?>[/code:3b2qg2qy]suckerfish3()
[code:3b2qg2qy]<?php echo ‘
<ul id="suckerfishnav">
<li><a href="#">Pages</a>
<ul>’ , wp_list_pages(‘title_li=’) , ‘</ul>
</li>
<li><a href="#">Archives</a>
<ul>’ , wp_get_archives() , ‘</ul>
</li>
<li><a href="#">Categories</a>
<ul>’ , wp_list_categories(‘title_li=&exclude=10’) , ‘</ul>
</li>
<li><a href="#">Blogroll</a>
<ul>’ , wp_list_bookmarks(‘title_li=&categorize=0’) , ‘</ul>
</li>
</ul>’;
?>[/code:3b2qg2qy]suckerfish4()
[code:3b2qg2qy]<?php echo ‘
<ul id="suckerfishnav">
‘ , wp_list_pages(‘title_li=’) , ‘
<li><a href="#">Archives</a>
<ul>’ , wp_get_archives() , ‘</ul>
</li>
<li><a href="#">Categories</a>
<ul>’ , wp_list_categories(‘title_li=&exclude=10’) , ‘</ul>
</li>
</ul>’;
?>[/code:3b2qg2qy]suckerfish5()
[code:3b2qg2qy]<?php echo ‘
<ul id="suckerfishnav">
<li><a href="’ , bloginfo(‘url’) , ‘/">Home</a></li>
‘ , wp_list_pages(‘title_li=’) , ‘
<li><a href="#">Archives</a>
<ul>’ , wp_get_archives() , ‘</ul>
</li>
<li><a href="#">Categories</a>
<ul>’ , wp_list_categories(‘title_li=&exclude=10’) , ‘</ul>
</li>
</ul>’;
?>[/code:3b2qg2qy]April 23, 2008 at 11:01 am #2161AnonymousMemberoh man thats awesome, thanks. Did I tell you that you rock? Cause you do!
April 23, 2008 at 11:11 am #2162imported_RyanMemberLol, thanks William ” title=”Smiley” />
Let me know if it doesn’t work. I haven’t tested any of those codes and there’s always a possibility I made a mistake.
December 14, 2008 at 4:39 pm #2163AnonymousMemberTHANKS! finally an solution
December 15, 2008 at 3:53 am #2164imported_RyanMemberThis is quite an old topic and is a little out of date now:
You can do the same thing with categories with the following code:
[code:1spth0gs]<?php wp_list_categories(‘title_li=&depth=3’); ?>[/code:1spth0gs]I’ll consider adding the ability to change the depth via the admin panel for a new version of the plugin. That way you would be able to modify the number of levels via the admin page instead of modifying the code itself.
-
AuthorPosts
- You must be logged in to reply to this topic.