Tag Info

New answers tagged

0

Please note, specific support questions to third party themes are off topic, so I will treat this in a general way, you should be able to implement this with your current theme To make your code work on only one menu, you need to target that specific menu only. To do that, you will need to check the current menu item location, and if it mathches a given ...


0

stephen's answer is good. but i put it one step further: <?php $location = 'footer_navigation3'; if (has_nav_menu($location)) : $menu_obj = get_menu_by_location($location); wp_nav_menu( array( 'theme_location' => $location, 'items_wrap'=> '<strong>'.esc_html($menu_obj->name).'</strong><ul id="%1$s" ...


2

When you filter wp_nav_menu, you get the nav menu arguments as second parameter $args. That's an object (a stdClass), set by WordPress while figuring out which menu to use, with an entry named menu. This is the whole nav menu object. Its title is in the entry name. Here is a trick: you can pass custom arguments to wp_nav_menu(). Let's say you are calling ...


0

It seems to me, you are trying to get the ancestors by the actual post, while you most likely should get the ancestors according to the menu item. Why? Because setting up a hierarchy in the menu does not change the actual post, especially the post_parent property won't be changed - in short: (other) post type and menu item (which actually is a post type too) ...


2

the dashicon will only available to you on admin menu images. if you want it on your menu item then you must followed option B. means using awesome font library. for this you need to add it from this : http://fortawesome.github.io/Font-Awesome/ i hope this will helps.


0

Ok, an answer to all. First, thank you for you help. Anyway, none of your solutions really address my issue. I don't like custom links on nav menus, at all. And that's because they're not dynamic, you cannot build them dynamically. So when you move the site and change url (for example, from staging to production) you'll have to remember to manually change ...


0

Just create an archive-{post_type}.php when you create a custom post type and include this function: flush_rewrite_rules(); Make a page of your custom post type. It's called an archive page.


2

Custom post type archive page does not need "dumb" Page. In fact, there could be the culprit. You should try this: Remove /* Template Name: Staff */ from archive-staff_member.php (not needed) Remove "dumb" stuff Page (if created). There could be some permalink conflict. Go to Admin > Settings > Permalinks and re-save it (it will regenerate rewrite rules) ...


0

Yes, the function is_post_type_archive only works in archive.php To have an item on nav menu links to your staff_member, you will add a custom link menu item in stead of a page whose template is your file tempate. The URL of that item will be got when you vardump this: get_post_type_archive_link('staff_member') And to custom the performance of the ...


0

In menu editor add Custom Link for each language with URL pointing to the site of your language and Link Text - <img src="url of your flag picture" alt="your language">


0

You can degrade the wordpress, Let's have a look at this tutorial visit https://www.youtube.com/watch?v=OwNR6NVhVFQ


0

I figured out a way to do this using the dashboard, not coding needed. BOOM! :) I was over thinking this. Step 1: Go to the page in the dashboard and edit the title to what you want. Update the page. Step 2: Goto Appearance>Menus and select the page with the coma in the name and click on the down arrow on the left, delete the coma (or whatever it is). ...


1

Create a template with a WP_Query to get posts with post type "post" then create a page and assign that template to that page. Templates: https://codex.wordpress.org/Templates Query by post type: https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters


0

Get custom navigation title using page id: function get_custom_nav_title( $menu_name, $page_id ) { $args = array( 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item', 'post_status' => 'publish', 'output' ...


0

You can remove that by add css script in you header.php file within the your wp-content>themes> folder. <style> #navi-wrap .nav-toggle{ display:none; } </style> If facing problem to do this, inform me please


0

wp_nav_menu displays the menu created in the Appearences > Menu section of wordpress admin area. That is where you can "print the menu with correct children names". Unless there is some other code in your functions that is messing with the wp_nav_menu function.


1

You are not providing the correct parameter to wp_get_nav_menu_object() function. It needs the menu ID or menu slug but you are providing the menu theme location. Obviously, I can not tell you what is the ID or slug of your menu. One way of getting the menu ID of the menu assigned to theme location is using get_nav_menu_locations(): $menu = ...


0

Your nav menu bar responcive while can user bootstrap framework. This like code insert in function.php Bootstrap responcive nav menu wordpress // This code insert in header.php <div class="container"> <nav class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <button type="button" ...



Top 50 recent answers are included