different class (css) for sidebar widgets
Check out this post I wrote on the wordpress.org board… it has some functioning code you can work from: http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets
Check out this post I wrote on the wordpress.org board… it has some functioning code you can work from: http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets
This can be retrieved with $color = get_user_option(‘admin_color’);, just don’t forget to check for empty return and default to something in that case. Native color schemes are called fresh (grey) and classic (blue).
You could use jQuery, if you’re open to a jQuery solution? <script type=”text/javascript”> jQuery(document).ready( function($) { $(‘#your_menu_id li’).has(‘ul’).addClass(‘has_children’); }); </script> Slight modification of what i posted here basically. Any menu item with a submenu will then have a has_children class you can target in the stylesheet.. #your_menu_id li.has_children { /* your styling */ } #your_menu_id … Read more
add_editor_style( $stylesheet ); http://codex.wordpress.org/Function_Reference/add_editor_style
Yes there is. You can add this to your themes header. <?php if(is_home()){ // we are on the home page echo ‘<link rel=”stylesheet” src=”https://wordpress.stackexchange.com/questions/17113/your_stylesheet” />’; } ?> You can also use other conditional tags to find out if you are on nearly every type of WordPress page. Conditional Tags Following on from the comments below, … Read more
This isn’t really WordPress specific, but from the server perspective it would add additional http requests for visitors to load additional css files, versus pulling the same site-wide css file from cache. From a css perspective, I prefer to keep it all in one file. Some people prefer to organize things differently, like all text … Read more
Don’t use a shortcode for wp_enqueue_style(); it won’t do any good, because by the time the shortcode is parsed, all the relevant hooks ( wp_head, wp_print_styles) will have already fired. Write a function, in functions.php, to enqueue different style sheets based on is_page( $id ) (where $id can be an ID, slug, or title). Then … Read more
you can check with the_posts hook if your shortcode exists and only enqueue the style if so : function check_for_shortcode($posts) { if ( empty($posts) ) return $posts; $found = false; foreach ($posts as $post) { if ( stripos($post->post_content, ‘[CHANGE_TO_YOUR_SHORT_CODE’) ) $found = true; break; } if ($found){ $url = get_bloginfo( ‘template_directory’ ); wp_enqueue_style( ‘my_login_Stylesheet’,$url.’/my_login_Stylesheet.css’ ); … Read more
EDIT Forget my answer below. You could simply use wp_register_style and wp_enqueue_style described in this answer. You could do it with an additional query variable. Add a new variable to the $query_vars array with the query_vars filter On the template_redirect action, make sure your custom.php-css file is included, if the query variable is set. // … Read more
Like Justin Tadlock says in your referenced article, the body_class() provides the ability to add classes dependant on the type of term. Given that you indicate your php knowledge is still growing; this maybe the best solution. The codex provides a list of classes on a body_class enabled: http://codex.wordpress.org/Function_Reference/body_class If that isn’t sufficient; wordpress has … Read more