Hello,
Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.
The title and description that you set on the templates will not be applied to the posts/archives where you apply the template. If the issue is related to something else, please share some screenshots of the issue so we can check and assist you further. You can use a tool like https://imgbb.com/ to share the screenshots.
We really look forward to helping you.
Hello,
I have made some changes to the filter and now it is adapting to the language of your site:
add_filter( 'rank_math/frontend/title', function( $title ) {
if(is_post_type_archive('faqs-proctoring')){
if (pll_current_language() == 'es') {
$title = "FAQs Preguntas Frecuentes";
}
if (pll_current_language() == 'en') {
$title = "FAQs";
}
return $title;
}
return $title;
});
Please modify it to output your desired titles in both languages.
Hope this helps.
Hello Jaideep
Thank you very much again for all your help.
I see that it works if it’s in Spanish I see one title, but if I’m in English I see another title. that’s very good.
I only have one doubt left, and that is what happens when a taxonomy depends on this file, for example: https://staging2.smowl.net/es/faqs-proctoring/instructor/ the title in this case that it shows could also be changed ?
thank you so much again
Hello Jaideep
Please excuse so many questions.
I would like to know if this would be ok because I would also need to be able to include the description, in fact, I don’t even know if the SEO is going to ask me to also include the schema (I think)
add_filter( 'rank_math/frontend/title', function( $title ) {
if(is_post_type_archive('faqs-proctoring')){
if (pll_current_language() == 'es') {
$title = "Preguntas frecuentes SMOWL";
$description = "Esta es mi descripcion";
}
if (pll_current_language() == 'en') {
$title = "FAQs SMOWL";
$description = "Esta es mi descripcion en inglés";
}
return $title;
return $description;
}
return $title;
return $description;
});
In any case, with being able to insert the description for now, I think it would be fine and, of course, being able to do this in the taxonomies as well.
Again thank you very much for all your help.
Hello,
This filter only modifies the title. To change the description, you need to use this filter:
/**
* Allow changing the meta description sentence from within the theme.
*
* @param string $description The description sentence.
*/
add_filter( 'rank_math/frontend/description', function( $description ) {
return $description;
});
Hope this helps.
Thank 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.