• Hi! I have just installed your plugin, and it’s working really well. Because I’m using the Thesis theme, I’ve put “thesis_post_image” in the “Post thumbnail meta field name” setting. This works with posts that have a Thesis post image. However, some of my posts don’t have a Thesis post image, but they do have a Thesis thumbnail image (which is referenced by the “thesis_thumb” post meta field).

    It would be great if there was a way to specify multiple meta fields, so that if no image is found in the first you then look in the second. So in my case I would like to put the following in the “post thumbnail meta field names” setting: “thesis_post_image,thesis_thumb”.

    • This topic was modified 7 years, 9 months ago by bobthedino.
    • This topic was modified 7 years, 9 months ago by bobthedino.
    • This topic was modified 7 years, 9 months ago by bobthedino.
    • This topic was modified 7 years, 9 months ago by bobthedino.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ajay

    (@ajay)

    I’m not familiar with Thesis. Is there a reason that there are two different thumbnail metas?

    Any reason why the default Post Featured Image isn’t used?

    Thread Starter bobthedino

    (@bobthedino)

    Hi, many thanks for replying! The problem is that the site has over 1300 posts dating back over ten years, and the various image and thumbnail fields have not been used consistently. Some posts only have a “thesis_thumb” thumbnail, other posts only have a “thesis_post_image” – and some posts have no other images in them, such as in the body of the post content. In general I don’t think the standard Post Featured Image has been used, either – I think the thesis_post_image is a Thesis-specific replacement for Post Featured Image.

    So I have tested “thesis_post_image” and “test_thumb” meta field names in CRP separately, and they produced the desired results, but there’s no way to specify both, hence my question.

    • This reply was modified 7 years, 9 months ago by bobthedino.
    Plugin Author Ajay

    (@ajay)

    This is the code that checks and pulls from the post meta.

    https://github.com/WebberZone/contextual-related-posts/blob/master/includes/media.php#L93

    You could potentially write a filter function for crp_get_the_post_thumbnail that would check if the $output is blank and then write your code to fetch the postimage from the meta based on the code above.

    For now, it might be easier to edit the media.php file to pull a second post meta if the default doesn’t work.

    I like the idea of multiple metas. I’ll put this on the todo list

    Thread Starter bobthedino

    (@bobthedino)

    That’s great, thanks – I’ll investigate your suggestions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multiple post thumbnail meta field names?’ is closed to new replies.