voceconnect / multi-post-thumbnails

Adds multiple post thumbnails to a post type. If you've ever wanted more than one Featured Image on a post, this plugin is for you.
143 stars 63 forks source link

How to use the argument "add_image_size()" #109

Closed andresglx closed 7 years ago

andresglx commented 8 years ago

Hi there,

Could you please tell me how to use correctly the argument "add_image_size()" ?

This is the piece of code I am using and it works but on debug mode on it returns the following warning:

<?php if (class_exists('MultiPostThumbnails')) :
    MultiPostThumbnails::the_post_thumbnail(
      get_post_type(),
      'hover-image',
      add_image_size(),
      'team-member'
    );
    endif;
?>

Warning: Missing argument 1 for add_image_size(), called in /Applications/MAMP/htdocs/myproject/wp-content/themes/mytheme/sections/onepage-team.php on line 23 and defined in /Applications/MAMP/htdocs/myproject/wp-includes/media.php on line 246

Notice: Undefined variable: name in /Applications/MAMP/htdocs/myproject/wp-includes/media.php on line 249

Cheers!

chrisscott commented 8 years ago

You'll want to add the image size (docs) separately and reference the size as noted in the plugin docs.

andresglx commented 8 years ago

Hi Chrissscott,

Yes I did that. Could you paste an example of the code for your plugin supposing I have declared the image size on functions.php , please?

Thanks,

chrisscott commented 8 years ago

Have you looked at the docs? If there's something there that's unclear, let me know and I'll see about updating the docs.