-
Hi dear. i use custom field to show image on my wordpress posts
For posts i use this code (found here on an old ticket)add_action('wp_head','banner_image_opengraph');
function banner_image_opengraph() {
if(get_post_type() == 'post') { //name of the post type
$attachment_url = get_post_meta(get_the_ID(),'rehub_offer_product_thumb', true); //name of the custom field
echo "<meta property='og:image' content=$attachment_url>";
}
}The preview seo image on categories and custom taxonomies now it is related to the last post in the category or taxonomy (it is shown as a preview of the SEO image of the last post) and is not the image of the category or taxonomy
Thanks in advance for the support
You must be logged in to reply to this ticket.