• Resolved anonymized-14293447

    (@anonymized-14293447)


    Dear Author, I’m trying this plugin as a work around for the problem I have.
    You see, each on my custom-post-types uses an image that is determined by a custom-field key+value but this image is not recognised as a “featured image” neither as a “first image in post”. Maybe you could implement your plugin with a new feature?
    a) Setting featured image as pulled from the custom-field’s value, with the Admin choosing the source (i.e. the custom-field’s key)
    b) then the plugin scans for the post content and the post’s custom-fields and if it finds the choosen key it will output the corresponding value.

    Thank you for listening ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello Arsenalemusica,

    This is a lot different from what the plugin is doing. But I can give a few pointers so you can create this on your own.

    add_filter( 'post_thumbnail_html', custom_field_img, 20, 5 );
    
    function custom_field_img ($html, $post_id, $post_thumbnail_id, $size, $attr) {
       // get your field and recreate your own html for an <img/> tag
    
       return $html;
    }

    Which will work on get_the_post_thumbnail() also see /wp-includes/post-thumbnail-template.php round line 114.

    Hope this will help you get started.
    Good luck.

    Plugin Author Jan-Willem

    (@janwoostendorp)

    Did my answer help?

    Thread Starter anonymized-14293447

    (@anonymized-14293447)

    Thank you for catching up. I’m not a developer therefore I wouldn’t know where to start to include/tweak that bit of code into the plugin. But I’m keeping an eye on this plugin in case one day you will create more backend settings.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘suggestion for new feature: pulling image from custom field’ is closed to new replies.