Conditional config WP_HOME/WP_SITEURL does not update bloginfo(‘template_url’)?

Found the solution… the problem was due to placement of the conditional statement in the wp-config.php file. It needed to be inserted before the require_once(ABSPATH . ‘wp-settings.php’); line near the bottom of the default config file, otherwise the constants are already defined and cannot be redefined. So final section of the wp-config.php file now looks … Read more

How can I assign separate stylesheets to different pages?

The correct method is to enqueue the stylesheets, via callback hooked into wp_enqueue_scripts. You can add the contextual conditionals inside the callback: function wpse124258_enqueue_scripts() { if ( ! is_admin() ) { // Conditionally enqueue if ( is_front_page() ) { // Front page stylesheet wp_enqueue_style( ‘front-page-style’, get_template_directory_uri() . ‘/front-page-stylesheet.css’ ); } else if ( is_page() ) … Read more

How to check homepage contain blog post?

In the case of expound theme index page is used as homepage, and there is no static front-page in the theme. Try to add is_home() to the condition. function addtoexcerpt($excerpt) { ob_start(); $values = ob_get_clean(); return $values.$excerpt; } if( is_single()||is_category()||is_home() ) { add_filter(‘the_excerpt’,’addtoexcerpt’); } I hope this should help you.

Using filter in the widget causes fatal error

Your code should look something like this: class my_Widget extends WP_Widget { … function filter_where( $where=”” ) { … } function widget( $options ) { … add_filter( ‘posts_where’, array( $this, ‘filter_where’ ) ); $query = new WP_Query( $args ); remove_filter( ‘posts_where’, array( $this, ‘filter_where’ ) ); } } This will keep the function within your … Read more