Search and replace image urls in posts

I coudn’t solve it with a plugin or plain SQL, see this other question. Instead I exported all the posts with Tools > Data export > WordPress and deleted the posts. Then I run this python script over the exported XML file and imported the update xml file again. Tadaa… import re p = re.compile(r’http://([^/]*)/getfile/files.posterous.com/([^/]*)/([^/]*)/([^/]*)’) … Read more

Thumb doubles the image file size

What you need to do is to compress the image. WordPress offers a filter to set the compression ratio. function my_jpg_compression($args) { return 75; } add_filter(‘jpeg_quality’, ‘my_jpg_compression’); NOTE: What you are returning is the compression ratio. 70-80% is manageable and you will not notice much reduced image quality. Also, after applying this filter only future … Read more

Getting featured image of blog page rather than post image

This code might be what you’re after. This loops through page templates to grab the featured image. If you add it outside the loop in your page.php template (or index.php, depending on your theme), it should grab the pages’ featured image, not the posts’. <?php global $post; if ( isset($post) ) { //get the ancestors … Read more