Highlight another nav item

The page_css_class filter lets you modify the classes each menu item gets. Here we check if we are currently viewing a singular envira post type and the menu item slug is gallery. In that case we add a class to the array of default classes passed to the function. function wpd_page_css_class( $css_class, $page ){ if( … Read more

My Admin bar covers my sticky navbar [closed]

You can try this code with add in functions.php file of your current’s theme: add_action(‘wp_head’, ‘my_wp_head’); function my_wp_head(){ echo ‘<style>’ .PHP_EOL .’body{ padding-top: 70px !important; }’ .PHP_EOL .’body.body-logged-in .navbar-fixed-top{ top: 46px !important; }’ .PHP_EOL .’body.logged-in .navbar-fixed-top{ top: 46px !important; }’ .PHP_EOL .’@media only screen and (min-width: 783px) {‘ .PHP_EOL .’body{ padding-top: 70px !important; }’ .PHP_EOL … Read more

How to include a third level with wp_get_nav_menu_items function

Seems that nobody has an answer to this question, so I followed @Zlatev advice and created a custom walker class… Download the plugin from GIT and add it to your theme, add the custom walker below to a include() or directly into your functions. <?php /** * Required plugin * https://github.com/adgsm/multi-level-push-menu */ class Push_Menu_Walker extends … Read more

Disable most recent & view all (TABS) on nav-menu.php

You can introduce a js file exclusively for admin panel doing this in functions.php: //Admin JS add_action(‘admin_init’, ‘custom_admin_js’); function custom_admin_js() { wp_register_script( ‘admin-js’, get_stylesheet_directory_uri() . ‘/js/admin.js’ ); wp_enqueue_script( ‘admin-js’ ); } And in admin.js file: jQuery(document).ready(function($) { $(‘*[data-type=”tabs-panel-posttype-page-most-recent”]’).fadeOut(); $(‘*[data-type=”page-all”]’).fadeOut(); $(‘*[data-type=”tabs-panel-posttype-page-search”]’).trigger(“click”); });