Closed steffib2010 closed 8 years ago
To add secondary images to posts, you should be able to put this code (adapted for your project) more or less anywhere in functions.php, I think:
if (class_exists('MultiPostThumbnails')) {
new MultiPostThumbnails(
array(
'label' => 'Secondary Image',
'id' => 'secondary-image',
'post_type' => 'post'
)
);
}
This should cause the admin screens for posts to feature the secondary image meta box. However, if you add secondary images to your posts you'll also need to update the files that display posts to visitors to your site.
Thanks, that worked great! And how do I show this secondary image? What do I need to include where to chose a thumbnail when posting this blog entry to facebook or pinterest?
Use the method the_post_thumbnail - see here https://github.com/voceconnect/multi-post-thumbnails/wiki#user-content-display-the-thumbnail
Sorry, but where do I need to insert this code?
Wherever you want to display the image(s)! This will require you (or someone on your behalf) to edit your theme's code.
Understood. But what if I don't necessarily want to display the secondary image but want to use it as an option for pinning the post to Pinterest or sharing on Facebook. I would like to have a choice between the featured image and the secondary image when sharing the post. Is that possible?
I'm sure it is, but again I think you'd need to actually edit the theme
Closing due to age. Please re-open if needed.
I just activated the plugin and cannot see the box for secondary featured image when creating a new blog post. I checked on your Quick Start page and it mentions some code to be included in the functions.php. I am not so familiar with programming, so I am wondering if you can tell me where exactly that code needs to be inserted. And do both sections you mention in te Quick Start guide need to be included? It would be great to get the same kind of box you published in your screenshot section.