Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

Filter:

gdbbx_topic_thumbnail_size

Control if the size of the image used for the topic thumbnail displayed in the list of topics lists.

This filter has 2 arguments.

Arguments

  • $size: the image size. It has to be the name of the registered image size or an array with the image dimensions. Default: ‘thumbnail’.
  • $topic: the ID of the topic to generate a thumbnail for.

Example

Set image size to ‘medium’.

add_filter('gdbbx_topic_thumbnail_size', 'custom__gdbbx_topic_thumbnail_size', 10, 2);
function custom__gdbbx_topic_thumbnail_size($size, $topic) {
  return 'medium';
}

 

0
0
678
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply