Every second post different class in blog view

Give this a try? function oddeven_post_class ( $classes ) { global $current_class; $classes[] = $current_class; $current_class = ($current_class == ‘odd’) ? ‘even’ : ‘odd’; return $classes; } add_filter ( ‘post_class’ , ‘oddeven_post_class’ ); global $current_class; $current_class=”odd”; and be sure you’re using <?php post_class(); ?>

Can not find css directory in header

Instead of that, try this in your functions.php // Proper way to enqueue styles (from https://codex.wordpress.org/Function_Reference/wp_enqueue_script) function wpse182193_load_style() { wp_register_style( ‘my-stylesheet’, get_stylesheet_directory_uri() . ‘/css/jquery-ui_002.css’, array(), ”); wp_enqueue_style( ‘my-stylesheet’ ); } add_action( ‘wp_enqueue_scripts’, ‘wpse182193_load_style’ );

How to format text of site subtitle

If you output the description with bloginfo(), you can use the filter bloginfo. add_filter( ‘bloginfo’, ‘wpse183972_description_italic’, 10, 2 ); function wpse183972_description_italic( $text, $show ) { if (‘description’ == $show) { $word = ‘WordPress’; $text = preg_replace( ‘^(‘ . preg_quote( $word ) . ‘)^’, ‘<em>$1</em>’, $text ); } return $text; }

Custom Plugin – CSS works, JS doesn’t

Would you please try below code to your plugin page. if the script file is your plugin root directory. function plugin_adding_scripts() { wp_register_script(‘my_test_script’, plugins_url(‘testscript.js’, __FILE__), array(‘jquery’),’1.1′, true); wp_enqueue_script(‘my_test_script’); } add_action( ‘wp_enqueue_scripts’, ‘plugin_adding_scripts’ ); Also: http://blog.aztora.com/add-css-js-into-wordpress-plugin/

Reduce white space in twenty fourteen

Good Day aparente001, I too had the same problem as you are referring to, so I know exactly what you are talking about. So to answer your question: Do I need to go through each of those cases and provide detailed css changes, or is there a more elegant way? You will have to go … Read more

wp_enqueue_scripts and CSS

You can set the priority in hook. Priority is the 3rd parameter in the hook. In the following example, wp_enqueue_scripts will have priority of 99 which is higher than normal priority. Default priority is 10. So it will load at last function load_last_style() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); } add_action( ‘wp_enqueue_scripts’, ‘load_last_style’, 99 );

Clients website shows blank page [closed]

Basically you need to check if the font were made White by editing the CSS or using Customizer, and accordingly restoring the CSS or the Entire theme is suggested. Also try changing the theme to a default one and then back to this one.

Add custom CSS class to custom post type

Have a look at post_class(). Check if the theme using it (every good theme should). If so then you can use post_class filter to add appropriate classes to the container. Here is an example how you can use that filter add_filter(‘post_class’, function($classes){ if(!is_singular(‘song’)) return $classes; $additional_classes = array(‘song-entry’, ‘masonry-entry’, ‘col-‘, ‘loop-entry’, ‘col’, ‘clr’, ‘span_1_of_3’); $classes … Read more

Target h1 on single post page [closed]

Did you try .post-156 h1{ color: #666666 !important; } If one of your wrapper elements, like <article> is unsing post_class() the post ID becomes a class of this wrapper like .post-156. So you can say all h1 which are contained in a wrapper with the class .post-156 Another possibility, if your <body>-Tag is using body_class(): … Read more