Tag Info

Hot answers tagged

2

I guess you mean the wp_page_menu fallback, where you can use the filters wp_page_menu_args and wp_page_menu to modify it's output. Notice that this function is a wrapper for the wp_list_pages() function, that ships with the wp_list_pages_excludes and the wp_list_pages filters. That function is again wrapper for the walk_page_tree() function, that ...


2

Ok, I solve this with the help of @TheDeadMedic's help. I use wordpress cookiepath constant and it works on wordpress perfectly. Here is the jquery code: jQuery(document).ready(function () { // baking cookie ;p function set_cookie(ID) { document.cookie = ID + "=opened; path=<?php echo COOKIEPATH ...


1

The best solution would be to allow a user to choose the nav menu location when adding/editing a page. Use a meta box with a dropdown (select) with all the available locations, and then save the selected location in a custom field: /** * Register the meta box. */ function wpse_183868_page_nav_menu_meta_box_register() { add_meta_box( ...


1

Welcome to stackexchange. When asking a question please try to be as specific in your question as possible. Try describing what you want to know – also using screenshots or wireframes is ok – but please avoid forcing others to ckick on a link to understand your question. Questions like "How can I do this?" are usually not very likely to get a lot of ...


1

Ok, so the problem was that I was adding the variable outside the function. After some cleanup, code looks like this and it works! function roots_setup() { // Variables $header_type = get_field('header_type','options'); if (($header_type)=='brand-centered') { register_nav_menus(array( 'brand_centered_left' => __('Brand Centered Navigation (Left)', ...


1

There's a much simplier (and more secure way*) way than hiding the user interface (show_ui=false) and adding a custom metabox to only display terms. If you remove the capability of the user to manage terms, however, not only do you have a secure solution, but user interface takes care of itself. As part of the register_taxonomy() you can specify the ...


1

I had a very similar issue. I needed to target a specific wp_nav_menu() and replace the a links with a class. Here is my solution in reference to the OP: function theme_add_menuclass( $classes, $args ) { if ( $args->theme_location == 'your-menu-location' ) { return preg_replace( '/<li /i', '<li class="your-class"', $classes ); } ...


1

Query parsing happens on every query run on a page, not just the main query. Your parse_tax_query is modifying the query for menu items in your menu. Check is_main_query() to make sure you only change the main query: function no_child_terms($query) { if( !is_admin() && $query->is_main_query() ){ ...


1

You may be able to use a WP_Query on nav_menu_item since it is its own post type. I've never done this but maybe it would work like you need it to, worth a shot. There are three other possibilities: Option 1 - Get Your Nav Menu Items There's a functions called wp_get_nav_menu_items() which will return you an array of your menu items that you can then loop ...


1

There's an easier way with no markup changes and minimal CSS. Live demo/fiddle here, code below: <ul> <li>1a</li><li>2a</li><li>3a</li><li>4a</li><li>5a</li><li>6a</li> </ul> ul { list-style: none; margin: 0; padding: 0; text-align: right; } li { ...


1

you can follow the below Steps : Step 1 : In the wp-admin, go to Appearance -> Menus,put the class on the menu item here "CSS Classes (optional)". If you can't see the "CSS Classes (optional)" in the menu item, then there is "Screen Option" in the right top of the screen and there are the options "CSS Class" under "Show advanced menu properties". Step 2: ...


1

to hide "HOME" label from wordpress navigation i use //change 105 with your home id #menu-item-105 span { display:none; } and for icon i use "Iconic Navigation" wordpress plugin



Only top voted, non community-wiki answers of a minimum length are eligible