filter on the_content stopped working when I updated to WP 3.6.1

It appears to be an issue with your RegEx pattern matching images. I modified $pattern to the following and it worked on a test page I setup. $pattern = ‘/<img(.*?)src=”https://wordpress.stackexchange.com/questions/114747/(.*?).(bmp”gif|jpeg|jpg|png)”(.*?)width=”(.*?)” height=”(.*?)” \/>/i’; There were some extra spaces which were throwing it off. I suggest using a RegEx tester to help you make sure your pattern … Read more

the_excerpt() does not work with has_excerpt()?

excerpt_length is only applied to generated excerpts— excerpts automatically generated from the post body. To trim your manually created excerpt, use the same function that trims the generated one— wp_trim_words. if(has_excerpt()) { $length = apply_filters(‘excerpt_length’,20); echo wp_trim_words(get_the_excerpt(),$length); } else { the_content(); }

Loading a sidebar on an Ajax call

is_admin() returns true if you’re doing an Ajax request. So this is why my code didn’t work. Instead I’ve done this: add_filter( ‘loop_start’, ‘my_sidebar_widget’, 25 ); function my_sidebar_widget() { if ( is_active_sidebar( ‘my_sidebar’ ) && (defined( ‘DOING_AJAX’ ) && DOING_AJAX ) || !is_admin() ) { echo ‘<div id=”my_sidebar”>’; dynamic_sidebar(‘my_sidebar’); echo ‘</div>’; } } defined( ‘DOING_AJAX’ … Read more