Create Google-Style Page Navigation for wordpress

March 26, 2009

It can be very tedious to navigate through a category on a WordPress blog. Your navigation options tend to be limited to “Next Page”/”Previous Page”. Not the most efficient method in the world… When you do a search on Google, you can skip to page 3, 4, 5 or anything else. And once you do, you can always click back to page 1. It makes flicking through a large number of results much, much easier. So, why don’t we recreate that in WordPress by ourself? This bit is easy. Just copy and paste the following... [Read the full story]

Include external pages in WordPress navigation

January 28, 2009

Imagine that you’re running a blog, but also have an online shop, a forum and some static pages. Do you’d like to be able to include theses pages in WordPress navigation? If yes, just read on. The solution to this problem is fairly simple. As the wp_list_pages() function returns only <li>…</li> elements, we just have to add static links to our external pages, just as shown below: <ul> <?php wp_list_pages('title_li='); ?> <li><a href="forum.php">Forum</a></li> <li><a... [Read the full story]

Adding A Private Page Into The Navigation menu

January 11, 2009

If you use pages which have the state private, they will not be shown in the navigation. Nevertheless it can make sense to show this specific page in the navigation, if you want to provide easy access to this page for your users. The page should only appear to privileged users for sure. I will show you a little hack, which will let you exactly do this. simply open the file where your navigation is (You can look up for the wp_list_pages() function) and insert this snippets instead of the function: <ul> <?php wp_list_pages('depth=1&title_li=0&sort_column=menu_order'); if(current_user_can('read_private_pages'))... [Read the full story]

Creating Two-Tiered Conditional Navigation in WordPress

November 29, 2008

If you want a common navigational scheme, with parent pages on top and child pages (if they exist) on bottom in wordpress. Then we’ll need code follow to help us: query the page determine if there are child pages properly highlight both the .current_page_parent and .current_page_item links. Here is the PHP: <ul id="nav"> <?php wp_list_pages('title_li=&depth=1'); ?> </ul> <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children... [Read the full story]

Using CSS Sliding Doors with WordPress Navigation

July 1, 2008

This sliding doors CSS hack allows you to create sophisticated tabs for your navigation bar. Sadly, WordPress core functions wp_list_pages() and wp_list_categories() don’t allow you to add the required span tag to use this technique. We are going to see how to proceed in order to use sliding doors in our WordPress theme. Sliding doors, why? There’s many articles available on the web about the sliding doors technique, so I’m not going to talk a lot about it. For people who don’t already know this famous hack, here’s... [Read the full story]