Creating “static” taxonomies to choose from, inside custom post type?

Make it show_ui => false Then to show it on the post edit screen add the box manually add_action(‘add_meta_boxes’, ‘meta_boxes_function’); function meta_boxes_function() { add_meta_box(‘categoriesdiv’, ‘categories’, ‘post_categories_meta_box’, ‘blurb’, ‘side’, null, array(‘taxonomy’ => ‘categories’)); } use this code for every static term if(!term_exists(‘term1’, ‘categories’)) wp_insert_term(‘term1’, ‘categories’);

Use wp_nav_menu() to display a Menu from another site in a Network install?

This is what I’ve used recently. It’s very simple but it works well for me. function wp_multisite_nav_menu( $args = array(), $origin_id = 1 ) { global $blog_id; $origin_id = absint( $origin_id ); if ( !is_multisite() || $origin_id == $blog_id ) { wp_nav_menu( $args ); return; } switch_to_blog( $origin_id ); wp_nav_menu( $args ); restore_current_blog(); } I’ve … Read more

Calling the Menu Title within wp_nav_menu array function

You can not get the menu title using wp_nav_menu(), you need to get the menu object as follow: //Change with the ID of your menu $menu_ID = 5; $nav_menu = wp_get_nav_menu_object( $menu_ID ); // then echo the name of the menu echo $nav_menu->name; With the above code, you can insert the menu name in wp_nav_menu() … Read more

register_nav_menus() won’t register menus

You don’t need to add any action to register your Nav Menu. Here are some quick steps for you to get your WordPress Nav Menu to work… Register Nav Menu if (function_exists(‘register_nav_menu’)) { register_nav_menu(‘header_menu’, ‘Header Menu’); } Define and Use Nav Menu in your Theme: Usually we place the Menu DIV code in header.php file; … Read more

Remove Container Element From wp_nav_menu() Markup

FYI :container => ” is a string operation and it’s default set by div you can’t use true or false like bool expression. Just change the container => ‘ul’ then i hope you will get what you want to see. for more details please read this : https://developer.wordpress.org/reference/functions/wp_nav_menu/ Thanks Musa

WordPress Shortcode in Menu Item Title

First of all download ‘Shortcodes in Menus’ plugin and install/activate it. Then in theme’s function.php add following code. add_shortcode( ‘current-username’ , ‘ss_get_current_username’ ); function ss_get_current_username(){ $user = wp_get_current_user(); return $user->display_name; } Now, in menu’s navigation lable write [current-username] shortcode. Same thing you can do for displaying avatar. This way it will display logged in user … Read more

fall back for main menu?

The parameter fallback_cb will be used when the user has no menu assigned to your theme_location. It should be a function that returns a string, but you can use __return_false() to suppress any output: wp_nav_menu( array( ‘theme_location’ => ‘primary’, // No menu available: no output. ‘fallback_cb’ => ‘__return_false’ ) ); You should always declare the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)