Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey,

    thanks for reaching out but I am not sure what exactly are you trying to do? Do you wish to change the thumbnails by using the custom fields? If yes, then first, go to your create-new-post page or — even better — in one of your previous already-published-posts. On the right top corner you should see the ‘Screen Options’ button; click on it for the drop-down menu to open. After that, tick the box next to ‘Custom Fields’.

    Now you should be able to see a new box below the editor called ‘Custom Fields’. Create new custom field, name your image that you would later like to use it as a thumbnail for this specific post (something like “My thumbnail”), enter the URL of the image (to value) you would like to use and finish with the click on the button “Add Custom Field”. Of course, don’t forget to save this draft, or publish the post when you’re ready.

    After that, visit the settings of (y)our plugin and scroll down to the bottom. The option called “Use custom field for thumbnails” should now be available, tick the box next to it, and select the value you’ve set up before (if you used “My thumbnail”, select that one).

    Once you have set this up, you just add a Custom Field with every new post, set the image you want to use for the thumbnail, while the name stays the same. Also worth noting is that you should keep the images you want to use for thumbnails as square as possible and that they’re not too big. The perfect size would be 151×151 pixels (or bigger), but that is not that crucial.

    Hope this helps, take care an have a nice day,
    Petra

    Thread Starter hariharakumar

    (@hariharakumar)

    Hi, What you said is right. But i am using Advanced Custom fields plugin (http://www.advancedcustomfields.com/) in my blog. When you use this plugin, custom fields appear at bottom of the post editor. But to display that custom fields on website we use the_field() ( link). But in your plugin code it is get_post_meta(). Due to which it is not working for me. Please tell me how to make it work with the_field() function. Thanks.

    Hey,

    you will need to edit the “thumbnailer.php” file. Go to line 371 (get_post_meta($related_post->ID, $options[“thumbnail_custom_field”], true);) and change it like this:

    $thumbnail_src = get_field('my_personal_thumbnail_field', $related_post->ID); //get_post_meta($related_post->ID, $options["thumbnail_custom_field"], true);

    -> my_personal_thumbnail_field is the name of the field you’d like to use for thumbnails – it’ll be hardcoded. Please note that this won’t be visible in the plugin settings but you still need to go there and tick the box next to “Use custom field for thumbnails”…it doesn’t matter which field you choose here in the drop-down menu.

    We would like to point out that this is a hack and might have some unpredictable consequences, so unfortunately we cannot guarantee it will work under all circumstances (themes,…). And don’t forget, this change will be overwritten when you update the plugin!

    Take care and enjoy the weekend,
    Petra

    Thread Starter hariharakumar

    (@hariharakumar)

    It worked like a charm thanks for your code. I will remember not to update the plugin thanks once again.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Compatibility with ACF’ is closed to new replies.