WordPress Menu Customizer

You can do this two ways. Add new section to existing nav_menus panel and then add your controls to the section: $wp_customize->add_section(‘my_section’, array( ‘title’ => ‘My options’, ‘panel’ => ‘nav_menus’ )); $wp_customize->add_setting(‘my_setting’, array( ‘type’ => ‘theme_mod’, ‘settings’ => ‘my_section’, ‘capability’ => ‘edit_theme_options’, ‘sanitize_callback’ => ‘sanitize_my_setting’ )); $wp_customize->add_control(‘my_control’, array( ‘label’ => ‘My option’, ‘section’ => ‘my_section’, … Read more

Foundation Scripts not loading (custom theme)

Benoti Yes, that was it! Seems app.js needs to be the last item loaded. Here is the final function with a couple of changes for anyone interested: function foundation_scripts() { wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, get_template_directory_uri().’/js/vendor/jquery.js’, false); wp_enqueue_script(‘jquery’); wp_enqueue_script(‘foundation-js’, get_template_directory_uri().’/js/vendor/foundation.js’, array(‘jquery’), false, true); wp_enqueue_script(‘what-input’, get_template_directory_uri().’/js/vendor/what-input.js’, false, true); wp_enqueue_script(‘app’, get_template_directory_uri().’/js/app.js’, array(‘jquery’, ‘foundation-js’), false, true); }

Add a menu item to the logged in users author page?

You can use wp_nav_menu_items filter for this, and check if user logged in, and use get_author_posts_url($autho_id) as bravokeyl suggested: add_filter(‘wp_nav_menu_items’, function( $items, $args ) { $index = ‘top-menu’; // menu index key, if you’re not sure then var_dump( $args->theme_location ) global $current_user; if ( $current_user->ID && $index === $args->theme_location ) { $items .= sprintf( ‘<li … Read more

Menu for specific user

Actually I think you need to hide or show the menu items based on “User Role”. So here a possible solution would be creating menus for each roles and showing them by condition based on “User Role”. Here is the code- function the_dramatist_menu_change( $args=”” ) { $current_user = wp_get_current_user(); if( in_array(‘your-user-role’, $current_user->roles) ) { $args[‘menu’] … Read more

Menus not visible in Appearance after being registered

There’s nothing wrong with your theme_setup() function in your functions.php file. The error you get simply points out the fact that the menu name Main Menu already exists. In other to resolve this you should replace your Main Menu menu name definitions in your functions.php file with something other than what it currently is. It’s … Read more

WordPress fountainpress header is covering top bar

It is a conflict between your theme’s css and the admin header. Options are to modify your theme’s css, or remove the admin bar. To remove your admin bar add this to your theme’s functions.php file: add_filter(‘show_admin_bar’, ‘__return_false’);

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