Bulk-add featured images in posts with no featured image
you can use this plugins as you like : https://wordpress.org/plugins/default-featured-image/ https://wordpress.org/plugins/auto-post-thumbnail/
you can use this plugins as you like : https://wordpress.org/plugins/default-featured-image/ https://wordpress.org/plugins/auto-post-thumbnail/
This particular issue was caused by an environment missing GD. After installing GD on the server, the issue was resolved. Of course you will need to go back and re-submit your thumbnails to have correct cropping, or use a plugin to retroactively recreate your thumbnails.
For a one-off batch operation, you can use this plugin: http://wordpress.org/extend/plugins/add-from-server/ But first you should figure out why they don’t show up in the first place. Maybe complain to the theme developer.
You can use has_post_thumbnail() as condition and change output accordingly. Example from Codex: if(has_post_thumbnail()) { the_post_thumbnail(); } else { echo ‘<img src=”‘.get_bloginfo(“template_url”).’/images/img-default.png” />’; }
Use get_post_thumbnail_id() to retrieve ID, then wp_get_attachment_image_src() to retrieve array, that will have URL as first element.
Adding a post thumbnail is pretty easy, open content.php, if you’re using excerpts on your homepage find this <?php the_excerpt(); ?> then add this just above that line <?php the_post_thumbnail(‘thumbnail’, ‘class=alignleft’); ?> If you’re not using excerpts add it above <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘twentyeleven’ ) ); ?> If you’d like a … Read more
According to the wordpress documentation this is how it is supposed to work out of the box. Maybe I misunderstood the question, but by default the excerpt should strip html tags and graphics.
If you want to ensure your image sizes remain available when switching themes, then you should place them into a plugin. Create a .php file (name it what you want) and place it in wp-content/plugins/, then paste the following: <?php /* Plugin Name: My Custom Image Sizes Plugin URI: http://pippinsplugins.com/ Description: Images sizes to be … Read more
You need to use the_post_thumbnail instead of the_thumbnail within the loop. This is how it should be formatted: <?php if(have_posts()){ while(have_posts()){ the_post(); if(has_post_thumbnail()){ the_post_thumbnail(); } } }?>
A MYSQL Query cannot delete the files themselves. You will have to use wp_delete_attachment(). The following is a proof-of-concept for you to alter how you please. The featured image is stored in postmeta as _thumbnail_id. wp_delete_attachment() does the rest for you. <?php /* Plugin Name: Delete All Featured Images Description: Delete all featured images by … Read more