Welcome, guest!

Feel free to read the blog, browse for themes, or join the club.

Customizing Category Navigation

  1. I'm trying to customize my hybrid category navigation by adding some external links. I've inserted the following code into the functions.php file with no change to my site. I thought I'd used this code before and it worked. Not sure what's going on now.

    add_filter( 'hybrid_category_menu', 'custom_cat_nav' );
    
    function custom_cat_nav( $menu ) {
    	$menu = false;
    	$menu = '<ul id="cat-nav" class="menu sf-menu">';
    	$menu .= '<li><a href="http://somelink.com">Some link</a></li>';
    	$menu .= wp_list_categories( array( 'depth' => 4, 'exclude' => '1',  'title_li' => false, 'echo' => 0 ) );
    	$menu .= '</ul>';
    	return $menu;
    }
  2. You must be a logged-in exclusive member to view this reply.

  3. You must be a logged-in exclusive member to view this reply.

  4. That is fantastic Justin :)

    Is there a way to display say just 1 page and it's sub pages?
    Just want the home link first, then the categories, then the 'About Us' page/sub pages.

    echo '<div id="cat-nav" class="cat-nav"><ul class="menu sf-menu">';
    echo '<li><a href="http://www.example.com">Home</a></li>';
    
    echo str_replace( array( "\t", "\n", "\r" ), '', wp_list_categories( $args ) );
    wp_list_pages( array( 'title_li' => false ) ); // just display Category ID 2 menu items (About Us)
    
    echo '</ul></div>';

    Thanks for your time, kind regards, Ian

  5. You must be a logged-in exclusive member to view this reply.

  6. Thank you very much, that will work.

    It means they can't break the menu as I will add the pages as needed.

Reply

You must log in to post.

Limited Access

If you have an account, please take a moment to log in.

Non-exclusive members have limited access to the support forums.

To enjoy the full range of support, sign up for an exclusive membership in the theme club.

Support Forums

  • Bliss Theme (193 posts)
  • Hybrid Theme (17,006 posts)
  • Options Theme (10,322 posts)
  • Structure Theme (2,624 posts)
  • Visionary Theme (767 posts)
  • bbPress Themes (293 posts)
  • WordPress Plugins (1,617 posts)
  • General Discussion (3,972 posts)