Using custom post thumbnails
-
Hi
I would like to use a custom post thumbnail that is created by my theme. Currently there doesn’t seem to be a way to do this. I have implemented this by adding some code to the plugin but of course this will be lost when an update is released. Is there any chance of adding such a feature. I have included the code I have used to make this work for me below.
Cheers
wordpress-popular-posts.php line 1963 (immediately above
// get image from post / Featured Image
)else if ($this->user_settings['tools']['thumbnail']['source'] == "custom_size"){ $thumb .= get_the_post_thumbnail( $p->id, $this->user_settings['tools']['thumbnail']['field'] ); }
admin.php – after line 204 added
<option <?php if ($this->user_settings['tools']['thumbnail']['source'] == "custom_size") {?>selected="selected"<?php } ?> value="custom_size"><?php _e("Custom size", $this->plugin_slug); ?></option>
admin.php – modified lines 210 and 212, each time replacing the following
<?php if ($this->user_settings['tools']['thumbnail']['source'] != "custom_field" {?>
with
<?php if ($this->user_settings['tools']['thumbnail']['source'] == "custom_field" || $this->user_settings['tools']['thumbnail']['source'] == "custom_size"){} else {?>
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘Using custom post thumbnails’ is closed to new replies.