Predefined thumbnails with new shortcode?

[ad_1]

Hey @anonamix,

The shortcode has an undocumented parameter called thumbnail_build that can be used to have it list predefined thumbnails instead of WPP ones. I don’t recall the exact reason why it’s undocumented though (probably because there are some use cases where it won’t work as expected? It’s been a while since I last touched that part of the code) so keep that in mind.

To use it, you need to also make sure that:

  1. You define the width (in pixels) of the thumbnail with thumbnail_width, and it needs to match the width of your predefined thumbnail
  2. You define the height (in pixels) of the thumbnail with thumbnail_height, and it needs to match the height of your predefined thumbnail
  3. You set the thumbnail_build parameter with ‘predefined’ as its value

So, let’s imagine that you have a predefined image size called article_thumbnail and that its dimensions are 100px x 75px. Your shortcode then should look something like this:

[wpp thumbnail_build='predefined' thumbnail_width=100 thumbnail_height=75]

Of course, check your theme’s code to find the actual size you want to use and adjust the shortcode accordingly.

If you have any comments / questions please let me know.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer