How to add Categories to the top menu of the website?
You should be able to add categories with Appearance -> Menus. They are listed in the block below ‘pages’:
You should be able to add categories with Appearance -> Menus. They are listed in the block below ‘pages’:
You can do this one of three ways: The first been you would need to make the menu static within the theme itself so you have full control over all the anchor links and classes In the menu manager you could assign a custom class to the anchor link and then bind jQuery events to … Read more
I believe the esc_url function is what ultimately filters the url you enter in that field. Unfortunately, I don’t see how you could allow the skype protocol without manually editing that function in the core file wp-includes/formatting.php, which is always a bad idea. if ( !is_array($protocols) ) $protocols = array (‘http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, … Read more
You need to define the theme location when displaying with wp_nav_menu, i.e.: <?php wp_nav_menu( array( ‘theme_location’ => ‘left-menu’, ‘menu’ => ‘Left Menu’ ) ); ?>
The markup above looks like a menu was not actually assigned to the area and is using the wp_list_pages() fallback instead. Point release changes (e.g. 3.3 to 3.3.1) are always going to be for major bugfixes and/or security, never for changes in functionality.
this might be the cause: The $echo parameter is ignored when searchform.php is present. There is a issue in the WordPress Trac concerning this. from the codex: http://codex.wordpress.org/Function_Reference/get_search_form#Notes
When using wp_nav_menu you can pass arguments to it which help you style the output, look at: $container Whether to wrap the ul, and what to wrap it with. Allowed tags are div and nav. Use false for no container e.g. container => false . $container_class the class that is applied to the container. $container_id … Read more
So, based on your comment: wp_nav_menu is what I’m using now. But now I have to add ‘home’ menu item depending on certain criteria I’m going to propose a solution that will allow you to add a “Home” menu item to any menu, based on arbitrary conditions, using the wp_nav_menu_items filter (see tutorial here): <?php … Read more
Work around. if (is_page( ‘pagename’ ) || in_array(“5”, $post->ancestors)) { wp_nav_menu( array( ‘container_class’ => ‘subnav’, ‘menu’ => ‘visit’ )); } 5 being the ID of the page in question. So while this is a bit more work, needing and if / if:else statement for each page, it will scale to allow as many child / … Read more
Your code doesn’t because the global $post refers to the post/page being viewed (if there is one…). What is passed with nav_menu_css_class is a menu item – this is a particular post type. Among its properties are: object which stores: the post type if the link refers to a post the taxonomy if the link … Read more