-
Hello, I’m trying to make og:url similar to og:image link, I’m using custom images as thumbnail for posts (using social snippet editor by Rank Math).
I have tried with this and it works but it only shows the original thumbnail image as og:urlfunction url ( $link ) {
return get_the_post_thumbnail_url();
}
add_filter( ‘rank_math/opengraph/url’, ‘url’);I want to show the custom image, the one that is showing on og:image, so og:url will show same link as og:image
I have tried this too but it’s not working
function url ( $link ) {
$img_url = $this->get_overlay_image( $this->prefix ) ? admin_url( “admin-ajax.php?action=rank_math_overlay_thumb&id={$image_meta[‘id’]}&type={$this->get_overlay_image( $this->prefix )}” ) : $image_url;
return img_url;
}
add_filter( ‘rank_math/opengraph/url’, ‘url’);
The ticket ‘og:url and og:image’ is closed to new replies.