Hey again karinlin,
Sorry about that, that was completely my bad. When I checked that page the first time I saw that text inside p element is placed in span so I just assumed they all are and never actually scrolled down to check the rest.
After checking again there is no way we can target p elements that has only text and no image with just CSS since images are also placed in p elements so we’ll have to use some jQuery for this. Please try placing this at the end of your theme functions.php (Ideally you’d want to use child theme so you don’t lose changes when you update the theme):
<?php
add_action('wp_footer','my1_javascript_function');
function my1_javascript_function(){
?>
<script>
jQuery(function(){
;(function ($) {$(function () {$(".entry-content p").each(function() {var $me = $(this); if ($me.find("a img").length) return true; $me.closest("p").addClass("reducewidth"); } ); }); })(jQuery);
})
</script>
<?php
}
?>
This script will search for p elements that are not having img inside them and add class to those p elements which we can later use to reduce the width with CSS.
When done with that replace the CSS code I provided above with this one:
div#primary {
width: 100%;
}
.reducewidth {
width: 61.5763547%;
margin-left: auto;
margin-right: auto;
}
This should fix it on both blog and single post pages.
Hope this helps ??
Cheers,
Bojan