Yoast SEO
Help with Custom Posts and og:image please! (2 posts)

  1. Siegoboy
    Posted 3 years ago #

    The Yoast WordPress SEO plugin firstly looks the og:image by looking for:

    Looks for a featured image
    If there isn’t a featured image, it looks for the first image within the_content
    If there isn’t a featured image or any image within the_contentthen use a default image

    My site does not use any of these, so the image defaults back to default image.

    Here Yoast explains how he created the code, can anyone help me apply it to my custom images?

    I use magic fields for custom post types and this is the code I use to get the image:

    <img src="<?php echo get_image ('shoe_image', 1 , 1 , 0 ) ?>" title="<?php echo get('shoe_image_title_tag'); ?>" alt="<?php echo get('shoe_image_alt_tag'); ?>" itemprop="image" />

    Thanks a lot!


  2. JayUK91
    Posted 3 years ago #

    Also having this exact issue with my Custom Post Type. Any resolutions as of yet?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.