Hello,
Thank you for contacting the support, and sorry for any inconvenience that might have been caused due to that.
Can you please share the error message you receive when you execute the code?
This should help us identify the cause of the issue.
Looking forward to helping you on this one.
Hey Jeremy,
It´s fine, no worries. I get this error message:
Your PHP code changes were rolled back due to an error on line 75 of file wp-content/themes/hitmag/functions.php. Please fix and try saving again.
syntax error, unexpected ‘>’
Thanks!
Hello,
It seems the issue is occurring due to this greater than sign here:
Please remove that character and see if this works.
Hey,
Weird, I tried that before, but now it works! Thanks!
But when I check the source the og_locale isn’t changed.
Hello,
Can you please clear your website and browser cache and try checking it again?
Let us know how that goes. Looking forward to helping you.
Yes, did all that. Didn’t worked. I’ve added the script in the rank-math.php file. Chown the file to the right user and chmod 755 the file.
Hello,
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,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Did that. Thanks!
Could you tell me when you are done? So I can put IP restrictions back? Also, this is a testing site to get it working, then I need to test it on another site. So could this be a theme specific problem?
Hello,
The code you had on your website didn’t have the correct quotes around the filter name and the result.
We changed that and it’s now displaying everything fine on your website.
Don’t hesitate to get in touch if you have any other questions.
Thanks!
Sorry but which quotes? This had to do with the rankmath, the hook r with the theme? Thanks again!
Hello,
The quotes that were surrounding the filter name and the word da_DK
were incorrect and if you check the filter now you’ll see that it shows the data inside those with the color red where previously was black, indicating that those were not the correct ones.
Don’t hesitate to get in touch if you have any other questions.
<?php
/**
* Allow developers to change the content of specific social meta tags.
*
* The dynamic part of the hook name. $network, is the network slug
* and $og_property, is the property which we are outputting.
*
* @param string $content The content of the property.
*/
add_filter( “rank_math/opengraph/facebook/og_locale”, function( $content ) {
$content = ‘da_DK’;
return $content;
});
Ok so this is the correct hook and I can use that for other websites?
Hello,
You should copy the code directly from the website and not from the forum because that can make it so the quotes are wrongly copied over.
Hope this helps solve your issues.
Don’t hesitate to get in touch if you have any other questions.
Okay! I got it Miguel! Thanks for the help and a good day!