Sunday, June 9, 2013

[Help Wordpress] Slider from posts removes paragraph tags


Slider from posts removes paragraph tags



I had the same issue - using a custom twentyten child theme, with no filters applied in the child, all other plugins disabled.


I had a look at the RS source and saw that your posts renderer is spitting out the raw post_content data from the WP_Post object. This is not the default behavior when WP renders a normal post though -- the autop filter and others are applied by default as part of the the_content() function. Thus, RS is rendering posts differently than a vanilla WP post page.


I worked around this by adding a filter to my child theme's functions.php file:



function rs_standardize_post_contents($m, $data, $options) {
if (is_a($data, 'WP_Post')) {
$data->post_content = apply_filters('the_content', $data->post_content);
}
}
add_filter('new_rs_slides_renderer_helper', 'rs_standardize_post_contents', 10, 4);


Cheers,
David



.

help.dimsemenov.com

No comments:

Post a Comment

Search

Other post