How to add date to navigation bar

It would be better to hook into the wp_nav_menu_{$menu_name}_items filter and add your date item in there: add_action( ‘init’, ‘wpse_106781_add_menu_items_hook’ ); function wpse_106781_add_menu_items_hook() { $theme_location = ‘thirdnav’; $theme_locations = get_nav_menu_locations(); /* Make sure the theme location is valid */ if ( ! isset( $theme_locations[ $theme_location ] ) ) return; /* Get the navigation menu assigned … Read more

Remove CSS & JS files from WordPress Main Page For Increase Pagespeed?

Does it work any better added to a hook with the conditionals inside? function my_deregisters() { if ( !is_single() ) { remove_action(‘wp_head’, ‘wp_page_numbers_stylesheet’); //wp_deregister_style( ‘fancybox’ ); // i think this can be removed //wp_deregister_script( ‘fancybox’ ); // i think this can be removed wp_dequeue_script(‘fancybox’); wp_dequeue_style(‘fancybox’); remove_action(‘wp_print_scripts’, ‘mfbfw_load’); remove_action(‘wp_print_styles’, ‘mfbfw_css’); remove_action(‘wp_head’, ‘mfbfw_init’); remove_action(‘wp_head’, ‘cforms_style’); } } … Read more

What are the Entry classes for?

Those are classes required by a particular microformat. I personally find it annoying that they are built into the Core, meaning that if you don’t want to support that microformat you have to take steps to remove it or have incomplete meta-data in the markup. However, if you do wish to support that microformat, the … Read more

Remove ALL css for a specific plugin page

You can try this function. function remove_all_theme_styles() { global $wp_styles; $wp_styles->queue = array(); } add_action(‘wp_print_styles’, ‘remove_all_theme_styles’, 100); This should work on any theme, but its not really a good approach to disable theme css just to make your plugin look good.

Add class active to static menu

What you’ll need to do is use get_ancestors(). Pass get_ancestors() your current page ID, and then search the resulting array for the menu item ID. If the menu item ID is in the array, set the class to active.

Correct check for any admin page with editor

Inspect the global variable $pagenow, and use post_type_supports() to find post types with an editor: function has_post_editor() { global $pagenow; if ( empty ( $pagenow ) ) return FALSE; if ( ! in_array( $pagenow, array ( ‘post-new.php’, ‘post.php’ ) ) ) return FALSE; return post_type_supports( get_current_screen()->post_type, ‘editor’ ); }

Order of stylesheets in child theme

The function wp_enqueue_style has the param $deps for depends. $deps (array) (optional) Array of handles of any stylesheet that this stylesheet depends on; stylesheets that must be loaded before this stylesheet. false if there are no dependencies. Default: array() Use this param to define the dependencies and you have an order. function blue_planet_scripts() { wp_enqueue_style( … Read more