Display Taxonomy Image on single.php

I’m using Taxonomy Images, and I can’t figure out how to display a category’s associated image on a single.php. Essentailly, when a user is viewing a post that utilizes the single.php template, it should display the post’s category’s image. Right now, it just doesn’t display anything. This is the code that I’m using: <?php $image_id … Read more

the_post_thumbnail ignores size parameter

I’m inserting an image in my theme as follows: the_post_thumbnail(‘large’); Which results in the following HTML: <img class=”wp-post-image” width=”660″ height=”440″ sizes=”(max-width: 660px) 100vw, 660px” srcset=”https://wordpress.stackexchange.com/uploads/IMG-1024×683.jpg 1024w, https://wordpress.stackexchange.com/uploads/IMG-300×200.jpg 300w, https://wordpress.stackexchange.com/uploads/IMG-768×512.jpg 768w, https://wordpress.stackexchange.com/uploads/IMG-254×169.jpg 254w, https://wordpress.stackexchange.com/uploads/IMG-578×385.jpg 578w, https://wordpress.stackexchange.com/uploads/IMG-665×443.jpg 665w, https://wordpress.stackexchange.com/uploads/IMG-1600×1067.jpg 1600w” src=”https://wordpress.stackexchange.com/uploads/IMG-1024×683.jpg”> Notice width=”660″ height=”440″ and sizes=”(max-width: 660px) 100vw, 660px” which doesn’t correlate with the size defined for … Read more

Fallback default image when there is no featured image

I have tried many options but without luck. It should be very simple approach but does not produce results. I am trying to insert default fallback image if there is no featured image in the post. My code that produces the thumbnail: <?php if ( has_post_thumbnail() ): ?> <div class=”post-card__image”> <a href=”https://wordpress.stackexchange.com/questions/336162/<?php the_permalink(); ?>”> <?php … Read more

Displaying a featured image (only img url) as the img src?

I have the following code: if (themedy_get_option(‘product_gallery’)) { add_action(‘genesis_post_content’, ‘themedy_product_images’, 1); } function themedy_product_images() { ?> <?php global $post; $images = get_children( array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => 999, ‘order’=> ‘ASC’, ‘orderby’ => ‘menu_order’ ) ); if ( $images ) { ?> <div class=”twocol-one”> <?php echo get_the_post_thumbnail( $post->ID, ‘product-400×600’ … Read more

Woocommerce – remove the default image placeholder? [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic. Closed 7 years ago. Improve this question How can I … Read more

How to check if user is uploading/setting an image as a featured image?

I’m making a limitation for image upload based on @brasofilo excellent snippet. In short, it limits user to only uploading image with minimum dimension. However I want to apply this only when user is uploading a featured image. I tried using $pagenow as a conditional, global $pagenow; if ($pagenow == ‘media-upload.php’) add_filter( ‘wp_handle_upload_prefilter’, ‘wpse_28359_block_small_images_upload’ ); … Read more

Thumbnails produce unwanted gray pixels on white background [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 7 … Read more