-
error
-
Hello,
I see you are encountering an error related to the
get_the_post_thumbnail_url
function. The image you provided seems to be a screenshot of the error message. Unfortunately, the provided image doesn’t show the specific error message or context where the issue is occurring.To better assist you, could you please provide more details about the error message or describe the issue you are facing with the
get_the_post_thumbnail_url
function? This will help us understand the problem better and provide you with a more accurate solution.Thank you for your understanding.
Sources:
Open Graph/Social Preview Image Is Not Displayed » Rank Math
Image SEO Options in Rank MathHello,
Thank you for contacting Rank Math support.
You have already defined the global $post variable. Please use the following filter:
add_action( 'rank_math/head', function() { global $post; $attachment_url = get_the_post_thumbnail_url ($post->ID); echo '‹meta name="thumbnail" content="'' . $attachment_url . '" /›'; }, 99 );
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
not work
Hello,
In this case, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
There were some syntax issues with the code. Please use the following one:
add_action( 'rank_math/head', function() { global $post; $attachment_url = get_the_post_thumbnail_url ($post->ID); echo '<meta name="thumbnail" content="' . $attachment_url . '" />'; }, 99 );
Hope that helps. Please don’t hesitate to let us know if you need our assistance with anything else.
thank you
Hello,
Glad that helped.
If you have any other concerns, please don’t hesitate to contact us anytime to assist you further.
Looking forward to helping you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.
The ticket ‘get_the_post_thumbnail_url’ is closed to new replies.