Add a class at specific element in custom Menu Walker

Count the level 0 elements in a static variable in the method and add an extra class if you hit the third. Sample code, not tested: function start_lvl(&$output, $depth) { static $column = 1; $indent = str_repeat(“\t”, $depth); if ($depth > 0) { $output .= “\n$indent<ul class=”subsubmenu”>\n”; } else { $column += 1; $extra = … Read more

How to Add Custom CSS to the Media Thickbox?

In WordPress 3.5, this hook works for me: add_action( ‘print_media_templates’, ‘wpse_75746_print_style_35’ ); function wpse_75746_print_style_35() { ?> <style> .media-modal-content, .media-sidebar { background: #FFF2D4 !important; } </style> <?php } In 3.4.2, this is the one: add_action( ‘admin_print_styles-media-upload-popup’, ‘wpse_75746_print_style_342’ ); function wpse_75746_print_style_342() { ?> <style> #media-upload { background: #FFF2D4 !important; } </style> <?php }

Category location styling

The way i fixed the issue was to insert the following code into my main CSS. .post-categories, .post-categories li {display:inline; padding: 0px;} I hope this helps others in this issue in the future.

Importing changes to Child Theme

Many good text editors have a “Compare Files” funciton, so use that to compare an unedited copy of the css file and your edited copy and save the differences for your child theme.

custom changes removed after plugin update

If it’s just a CSS change, load your own CSS stylesheet to override their CSS. If it’s the HTML of the plugin, then you will need to look at filter hooks to see what you can change. Some plugins are developer friendly and supply some filter hooks allowing you to change various things the plugin … Read more

Override theme style with other CSS on a specific page

You want the plugins style sheet to over ride your themes style sheet conditionally ( on one page). Dequeue your themes style sheet for a specific page conditionally. add_action( ‘wp_enqueue_scripts’, ‘remove_default_stylesheet’, 25 ); function remove_default_stylesheet() { if ( is_page( page id or slug) ) { wp_dequeue_style( ‘original-enqueue-stylesheet-handle’ ); wp_deregister_style( ‘original-register-stylesheet-handle’ ); wp_register_style( ‘new-style’, plugins_url(‘stylesheet.css’, __FILE__) … Read more