Polylang Compability

#439807
Viewing 12 replies - 16 through 27 (of 27 total)
  • Nigel
    Rank Math business

    Hello,

    1. The separator character I use » OR » was changed for –

    Please may you share an example of this issue so we can check what may be causing it, include the URL of the page and a screenshot

    2. The titles of all pages have changed to the page’s title, ignoring the SEO Title set on Rank Math. I mean, in a Post, the page title has changed to the H1 title, ignoring the SEO Title.
    Please confirm you have added && is_tag() to the if statement in the latest code snippet I shared with you. Please try adding adding “return $title;” at the bottom of the code snippet to return the default page title for the rest of your pages:

    
    add_filter( 'rank_math/frontend/title', function( $title ) {
    	foreach (pll_languages_list( ['fields' =>'locale'] ) as $current_locale){
    		if (get_locale() == $current_locale  && is_tag()) {
    			$opt_titles = get_option('rank-math-options-titles');
    			$title = \RankMath\Helper::replace_vars(pll_translate_string( $opt_titles['tax_post_tag_title'], get_locale() ));
    			return $title;
    		}
    	}	
    	return $title;
    });
    

    Hope that helps. Please let us know if you have questions.

    Hi Nigel! Yes, I’ve added the is_tag(), as you can see below:
    https://drive.google.com/file/d/1XYA_Xyy9jpYqgSE-IGmVlWTTx5wgqoQ7/view

    The bug is exactly what I’ve said to you, all the Posts are getting the H1 instead of Rank Math’s SEO title. And the separator character is changing to –

    PS: to share the URL with you, I need to put the code on, and I can’t because it’s not working well. So I try it everytime, but I comment it to not bug my website: https://nerydigital.com

    Best

    Nigel
    Rank Math business

    Hello,

    I checked a few URLs on your website, and they do not have the same H1 and title tags for example,

    https://nerydigital.com/es/filtros-en-instagram
    Title: “Filtros en Instagram: Cómo Crearlos y Mejorar Tu Alcance”
    H1: “Cómo Crear Filtros En Instagram y Aumentar Tu Alcance en la Red Social”

    https://nerydigital.com/filtros-no-instagram
    Title: “Filtros no Instagram: Como Criar e Alcançar Mais Pessoas”
    H1: “Como Criar Filtros No Instagram e Aumentar o Seu Alcance na Rede Social”

    Please try clearing your cache and check again. If that does not work, please share a screencast demonstrating the issue. You can use a tool like loom.com for screencasts.

    Looking forward to helping you.

    Nigel, thank you very much for your response, I really appreciate it, but I think you didn’t understand what I’ve said…

    I’ve said that I can’t leave your code live because it’s bugged, and it will influence my website’s performance. So I try it everytime you send something new here, but if it doesn’t work, I leave the code commented to not bug my website.

    As I’ve said before, and I prove here, with your code the SEO Title is being replaced for the H1 in each page. Also, the Meta Description is missing, as the Separator Character.

    Please check the source without your code here:
    https://drive.google.com/file/d/1Z9K7DxQfIyJeeYGRmodjq9W2x1N-mHiW/view?usp=sharing

    Now compare with your code applied here:
    https://drive.google.com/file/d/1Z6XvVryFq3NQHdCjsXzBJyu6lUxmMEc9/view?usp=sharing

    The page in that example is https://nerydigital.com/automacao-de-whatsapp

    Best

    Hello,

    There seems to be some confusion on what the code snippet is supposed to do.

    That code snippet is only getting applied, or at least should only be applied, to the tags of the website and does not have any effect on the actual posts.

    If you would like us to debug the issue further please create a staging website and share the credentials so we can make necessary changes and see the results immediately instead of going always back and forth with small little changes.

    Looking forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Miguel, I’ve shared the sensitive data, so you can check it. As I’ve said, the problem is when it’s not a Tag page, the title + meta description + separator character is bugged.

    https://b.nerydigital.com/hello-world (now with your code applied in this alternative copy)

    You code is at Appearance > Theme File Editor > functions.php (Child Theme)

    Best

    Hello,

    The filter was returning the variable inside the if statement and when that happens, unless the if statement loads the data won’t be passed to the filter.

    We have made a slight modification and the SEO title now shows in the title tag of the page.

    Don’t hesitate to get in touch if you have any other questions.

    Thank you VERY MUCH, Miguel! Now the tag’s title, description and everything else are working fine. 🙂

    Just two more questions and I will close this discussion:

    1. If I want to replicate the same logic for custom posts archives (just the archive, not individuals), what can I use instead of && is_tag()? My archives’ page are: https://nerydigital.com/content and https://nerydigital.com/es/content. The name of the custom post is “content”, created with “Custom Post Type UI” plugin.

    2. Do you consider to update Rank Math plugin sometime to be compatible with Polylang using that code you helped me with (to get the string translations automatically)?

    Thank you very much!
    Best

    Hello,

    1. You should be able to replace that with the following function: https://developer.wordpress.org/reference/functions/is_post_type_archive/

    You just need to pass the CPT name inside the function to check if the current page is an archive page of that CPT.

    2. We cannot confirm if this is something that can be included in the plugin. Our dev team would need to assess the situation and advise further if adding this directly wouldn’t cause other features to break on sites not using Polylang.

    If this is included in the future we’ll also update you on the same.

    Don’t hesitate to get in touch if you have any other questions.

    Thank you very much Miguel! All clear and all problems solved. 🙂

    By the way, I’m sure the problem is something by your side or Polylang’s side. So if you solve this in the future, working together, it would be perfect!

    All my best

    Hello,

    You are very much welcome and thank you so much for your input and feedback. It is very much valued.

    Please do not hesitate to let us know if you need our assistance with anything else. We are here to help you.

    Thank you.

Viewing 12 replies - 16 through 27 (of 27 total)

You must be logged in to reply to this ticket.