Fixing image names for a site being restored
Fixing image names for a site being restored
Fixing image names for a site being restored
Using custom image resizing script in a page
How to update the values when the featured image has changed?
You can set post featured image space with css. like this: img.featured_image{ width: 50px; height: 50px; }
Try setting an array for meta_query instead, I do not think using just a string for it is the intended usage, but this may work instead in your case: ‘meta_query’ => array( array( ‘key’ => ‘_thumbnail_id’, ‘compare’ => ‘EXISTS’ ) )
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
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
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.
If you look at your code, you see that parameters for a WP_Query are defined in $defaults. There is also ‘post_type’ => ‘any’ defined which could be changed to ‘post_type’ => ‘post’ to query only for posts, not pages etc. As you see later on, the search function redefines the post_type to $context based. After … Read more
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