Skip to main content

With this filter you can adjust the default placeholder-images in the theme.

add_filter('at_post_thumbnail_placeholder', 'at_set_new_placeholder', 11, 4);
function at_set_new_placeholder($url, $post_id, $size, $args) {
	if($size == 'at_thumbnail') {
		$url = 'https://placeholdit.imgix.net/~text?txtsize=34&txt=360%C3%97189&w=360&h=189';
	}
	
	return $url;
}

With this you have the option to deposit for any size its own placeholder-image. You just have to adjust the URL. You can control this for individual products via $post_id.

A list of all currently defined sizes in the theme:

 Name Size (in px)
 product_tiny  50 x 50
 product_table  100 x auto
 150 x 150
 product_list  162 x 162
 product_grid  262 x 262
 at_thumbnail_9  263 x 138
 at_thumbnail  360 x 186
 product_gallery  360 x 360
 at_large_9  848 x 446
 at_large  1140 x 600

Was this article helpful?

1 Star2 Stars3 Stars4 Stars5 Stars
(No Ratings Yet)

Keine Kommentare vorhanden


You have a question or an opinion about this post? Share it with us!

Your email address will not be published. Required fields are marked *

*
*