How to select featured images for 1500 posts?

You can run a script that will programmatically set the featured image for each post. You can use the first attached image for this. To get the attached images run a query for the posts and loop through each one and use get_children() setting the post_parent to the current post id in your loop. $posts … Read more

How to watermark wordpress images from wp-content/uploads folder with htaccess and php?

The rewrite condition !-f means “if file does not exist”. Since the files exist, the rule is never reached. Just changing the order should fix the problem. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^wp-content/uploads/(.*\.(jpe?g|gif|png))$ watermark.php?p=br&q=90&src=wp-content/uploads/$1 [L] RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>

Surround uploaded image link with div

You can use a image_send_to_editor filter hook to achieve what you want. <?php add_filter( ‘image_send_to_editor’, ‘imagehtmlchange’, 10, 8); function imagehtmlchange($html, $id, $caption, $title, $align, $url, $size, $alt) { // your banny wrote – put your code here return $html; } ?>

adding image in the header of my dev widget

From your post what i understood is u need to show images saved in your plugin folder.if yes then you can go with plugin_url to link images in a plugin directoy without specifying the plugin folder name. Example: <?php echo ‘<img src=”‘ . plugins_url(‘/images/header-background.png’, __FILE__) . ‘” > ‘; ?> The ouput will be like … Read more