Sorry, I did not make myself clear because I do not know the theme of your site. So I am going to describe my situation, and you will understand what’s similar or different for you.
The theme of my site is a child theme of Twenty Twenty-Two that I have modified. I am using the same template for all my pages and a different one for all my posts. These 2 templates consist of 3 parts : a header, a main part and a footer. I use the header and the footer to display what I want to appear on each page, respectively each post, without having to retype it each time.
My page template and my post template use the same header, where I have placed the navigation and the pll short-code. Having only one header guaranties that if the short-code works for the pages, it will work for the posts.
When you said the short-code woks for the pages and not for the posts I imagine you had one header for the pages and another one for the posts, each with its own navigation and short-code.
I inspected the “questionnaire-presentation” and did not see the pll switcher : the short code was absent or having some kind of problem. I went to inspect the “language-test” page that you had posted previously and for which the short-code worked. It was now different : the navigation appears twice, in the header and in the main part, the pll switcher was no longer in the header but in the main part. The short-code works everywhere, but if you place it in the main part, you will have to retype it on every page and on every post, if you want the switcher to appear and hide the menus in languages other than the language of the current page or post. The short-code does both things together. If, for example, you want the switcher on pages and not on posts, then you can use 2 different headers, one for pages with the shot-code and all the menus and a different one for posts with only one menu in the language you want.
Let me know if this makes sense for you or if you have more questions.
-
This reply was modified 2 years, 4 months ago by michel.b.
-
This reply was modified 2 years, 4 months ago by michel.b.