WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Siegoboy
    Member
    Posted 1 year 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!

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. JayUK91
    Member
    Posted 1 year 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

About this Topic

Tags

No tags yet.