How to set an equal image size for a Fallback Image as used for the Featured Image(dynamicly)

You can get the width and height of the image size set back from the global $_wp_additional_image_sizes array via the image size slug, so that: global $_wp_additional_image_sizes; $size=”featured-image”; $width = $_wp_additional_image_sizes[$size][‘width’]; $height = $_wp_additional_image_sizes[$size][‘height’]; Then in your template just change the image attributes: <img src=”https://wordpress.stackexchange.com/questions/217134/<?php bloginfo(“template_directory’); >/images/thumb_featured_img.jpg” width=”<?php echo $width; ?>” height=”<?php echo $height; ?>” … Read more

Else condition not working while using has_post_thumbnail

You’re not quoting your HTML attributes – one section should be: if ( has_post_thumbnail() ) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID)); echo “<a href=”https://wordpress.stackexchange.com/questions/217333/$link”><img src=”$image[0]” width=”98″ height=”80″ class=”img-responsive” /></a>”; } else { echo “<img src=”$url” >”; } …the other should be: echo “<h3><a href=”https://wordpress.stackexchange.com/questions/217333/$link”>”; the_title(); echo “</a></h3>”; echo “<div class=”post-meta”><span class=”date-meta”>On <a href=”https://wordpress.stackexchange.com/questions/217333/$link”>”; the_time( get_option( ‘date_format’ ) … Read more

How to replace images?

They will replace the original image but if you are using thumbnails you will need to regenerate them because otherwise the thumbnails will be of the previous image. Yes, you need to manually regenerate them. You can use this plugin for the task.

How can I use a static (ish) URL for the featured image for a post?

I figured it out. Using the Genesis framework, you can do this, adapted from http://dreamwhisperdesigns.com/genesis-tutorials/genesis-default-thumbnails/ /** * Default Image * * @author Jen Baumann * @link http://dreamwhisperdesigns.com/?p=429 */ add_filter(‘genesis_get_image’, ‘dream_default_image’, 10, 2); function dream_default_image($output, $args) { global $post; $slug = $post->post_name; $thumbnail=”http://foodiefun.imgix.net/featured/”.$slug.’.jpg?fit=fill&bg=f9f9f9&w=400&h=600′; switch($args[‘format’]) { case ‘html’ : return ‘<img src=”‘.$thumbnail.'” class=”alignleft post-image” alt=”‘. get_the_title($post->ID) .'” … Read more