Hi Newspaper Team!
I have a question:
How to add a default featured image to all post that does not have images on it?
Website: http://www.elversiculodeldia.com/
Hi,
In this file single_template_4.php, Im editing these lines:
<?php
//if we have a featured image, show it
if (!empty($td_post_featured_image)) { ?>
<div class="td-big-slide-background"><div id="td-full-screen-header-image" class="td-image-gradient"></div></div>
<!-- preload the image -->
" alt="" style="display:none;"/>
<?php
td_js_buffer::add_to_footer(
'jQuery().ready(function() {' . "\r\n" .
'jQuery("#td-full-screen-header-image").backstretch("' . $td_post_featured_image . '", {fade:1200, centeredY:false});' . "\r\n" .
'});'
);
}
else {
echo '
';
}
?>
But it does not having the same efects, how can I set it to work?
Thanks in avance!
Hi,
You could use a plugin which sets the first image from each post (which doesn’t have a featured image) as a featured image.
Or you could enable the image placeholder from Theme Panel -> Post Settings -> Featured image – http://screencast.com/t/05xbAXNKW1
You can replace the image with your own – http://screencast.com/t/OyMmwTGGsHxX
Thank you, Emil G.
Hello there!
I have a specific problem. All images hosted on my server is accidentally deleted and now I have thousand article with broken (featured) link images. I have tried Image placeholder option as you mentioned above, but in vain. Only if I manually delete featured images, image placeholder is shown.
What to do? :/
Hi,
You can remove this code: http://screencast.com/t/GPmfShRoEt – this will display just the placeholder even if the post has a featured image set.
Thanks
You might try the plugin I use a lot … Auto Post Thumbnail Pro (on Envato) … it will create a new thumbnail and set as ‘featured’ based on first image in post, even if external image. I use it on all our sites as most of ours pre-date the use of ‘feautured’ image in WP, and so it’s an awesome tool. Might or might not be what you’re looking for, but it’s cheap. 🙂
@sandall Once the featured images are missing at the file level, the default image from the theme won’t work because the database still shows a featured is set, even though the file is missing.
I’ve been through something similar with imports and I was not able to find anything that could bulk modify the posts in question. You have to manually go through each post and unset the featured image. Another may be an SQL query to remove the featured image info from each post at the database level, but that’s advanced and needs to be undertaken by someone familiar with WordPress and MySQL.
Wish there was an easy fix for this. Good luck!
