Suckerfish Dropdown demonstration using Pages only

The menu below can be displayed by placing the following code into your theme after installing "Ryan's Suckerfish Dropdown Plugin"

<ul id="suckerfishnav"> <?php wp_list_pages('title_li='); ?> </ul>

Suckerfish Dropdown demonstration using Pages, Archives, Categories and Blogroll

The menu below can be displayed by placing the following code into your theme after installing "Ryan's Suckerfish Dropdown Plugin"

<ul id="suckerfishnav"> <li><a href="#">Pages</a> <ul> <?php wp_list_pages('title_li='); ?> </ul> </li> <li><a href="#">Archives</a> <ul> <?php wp_get_archives(); ?> </ul> </li> <li><a href="#">Categories</a> <ul> <?php wp_list_categories('title_li='); ?> </ul> </li> <li><a href="#">Blogroll</a> <ul> <?php wp_list_bookmarks('title_li=&categorize;=0'); ?> </ul> </li> </ul>

Suckerfish Dropdown demonstration which lists all of the first level pages as main menu items (sub-pages in dropdowns) and the Archives and Categories as dropdowns

The menu below can be displayed by placing the following code into your theme after installing "Ryan's Suckerfish Dropdown Plugin"

<ul id="suckerfishnav"> <?php wp_list_pages('title_li='); ?> <li><a href="#">Archives</a> <ul> <?php wp_get_archives(); ?> </ul> </li> <li><a href="#">Categories</a> <ul> <?php wp_list_categories('title_li='); ?> </ul> </li> </ul>

test

Archive for December, 2007

Can that

Thursday, December 6th, 2007

Ignore the previous post, that method is silly. This new method works much better. It uses is_home to target the blog page directly, which is weird because I expected the blog page to target it instead. I found this tidbit of information at http://wordpress.org/support/topic/107583#post-596789. I haven’t figured out how to put your ‘blog’ page in a different order in your menu though, or at least not without building the menu manually.

<ul>
<?php
wp_list_pages(’exclude=9&title_li=&depth=1&sort_column=menu_order’); ?>
<?php
if (is_home()) {echo ‘<li class=”page_item current_page_item”><a href=”‘ , bloginfo(’url’) , ‘/blog/” title=”Blog”>Blog</a></li>’;}
else {echo ‘<li class=”page_item”><a href=”‘ , bloginfo(’url’) , ‘/blog/” title=”Blog”>Blog</a></li>’;}
?>
</ul>

The worlds crudest WordPress hack

Thursday, December 6th, 2007

This is an awful fix for this, but it does the trick, albeit you need to edit the raw code if you go past however many pages you’ve added to the list:

<ul>
<?php
wp_list_pages(’exclude=9&title_li=&depth=1&sort_column=menu_order’); ?>

<?php
echo ‘<li class=”page_item ‘; ?><?php
if (is_archive() || is_search() || is_404() || is_category() || is_single() || is_page(’1′) || is_page(’2′) || is_page(’3′) || is_page(’4′) || is_page(’5′) || is_page(’6′) || is_page(’7′) || is_page(’8′) || is_page(’10′) || is_page(’11′) || is_page(’12′)) {}
else {echo ‘current_page_item’; }
?>”><a href=”<?php bloginfo(’url’); ?>/blog/” title=”Blog”>Blog</a></li>

</ul>

Basically, the above code checks to see if the page is any page other than the blog page is and if it isn’t then it inserts the code current_page_item into <li class=”page_item … >.

I tried checking for the page directly, but I couldn’t figure out how. If is_page(’blog’) doesn’t seem to work despite it being a page. Because of this, the code checks for every page with an ID from 1 to 12 but ignoring 9 as that is the ‘blog’ page. It also checks to see if you are on an archive, search, 404, category or single page.

test post

Thursday, December 6th, 2007

This is a test post, testing, testing, testing 1 2 3

Hello world!

Wednesday, December 5th, 2007

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!