Change Menu Button Text [closed]

I figured this out myself. It can be changed in the PHP code rather than in the WordPress dashboard. Log into your web hosting (or access the files via ftp), open a file manger and find this file: wp-content/themes/’YourTheme’/header.php Where ‘YourTheme’ is the name of the theme you’re using. I’m using shoreditch. Edit this file. … Read more

How to modify mobile nav menu text in theme

You can leverage the use of the gettext filter to change the text. Add this code to your child theme’s functions.php or to a plugin: add_filter(‘gettext’, ‘wpse248225_change_text’, 20, 3 ); function wpse248225_change_text( $translated_text, $untranslated_text, $domain ) { if ( NECTAR_THEME_NAME !== $domain ) { return $translated_text; } // Make the changes to the text switch( … Read more

How to change the menu mark up with walker_nav_menu class?

I just posted an answer to this here: How to create this custom menu walker? Basically, you want your start_el and end_el to looks something like this: function start_el(&$output, $item, $depth=0, $args=array()) { $output .= ‘<a href=”#”><span>’ . esc_attr($item->label); } function end_el(&$output, $item, $depth=0, $args=array()) { $output .= ‘</span></a>’; }

wp_nav_menu returns false even though a menu is assigned to it

It turns out the fault was all mine. I was attaching a callback function to the wp_nav_menu_items hook that returned empty if it wasn’t the main menu… This was it: // Add logo in main menu add_filter( ‘wp_nav_menu_items’, ‘add_logo_in_main_menu’, 10, 2 ); function add_logo_in_main_menu( $items, $menu ){ /* Append logo to main menu */ if(is_admin() … Read more

wp_bootstrap_navwalker Fatal Error

As hinted at by the comment from the_dramatist, it is not enough to simply add the nav walker class file to your file structure. You must also load the file somewhere, typically in the theme’s functions file or a common include. Your nav walker class, path and filename will vary so update accordingly: require get_template_directory() … Read more

Pull Menu Items Into an HTML element

assuming you are adding this into a page template: $menu_list = wp_get_nav_menu_items( ‘All Pages’ ); if( $menu_list ) foreach( $menu_list as $menu_item ) { if( $menu_item->menu_item_parent == 0 ) { echo ‘<div><a href=”‘ . $menu_item->url . ‘”>’ . $menu_item->title . ‘</a></div>’; } } the above shows only top menu items with their links, no dropdowns. … Read more

Switch an entire nav menu if user is logged in

There are a couple of issues with the original code. In the if statement, $args[‘menu’] is being set to Non-Members Area (which will then evaluate to true). It looks like you actually want to be doing an equality check there. A good way to avoid this is to use Yoda conditions. Also, the $args array … Read more