- This topic has 15 replies, 5 voices, and was last updated 6 months, 1 week ago by Leo.
October 6, 2020 at 4:12 am #1474377David
I’ve recently implemented hreflang tags across a pair of sites (added to private info), both using GP premium.
I’ve used Elements – wp-head, to add them and it has worked on all pages and posts with the exception of:
The pages on which they appear properly and those on which they don’t are the same on the two sites.
Could you have a look for me? I’ll also include login details.October 6, 2020 at 5:00 am #1474434David
Those two pages are my home page and my blog page. It turns out in Elements’ Display Rules there are specific locations for ‘Front Page’ and ‘Blog’. I’d been using ‘Page’ for all, and then selecting the relevant page from the dropdown.
All working fine now.
Cheers!October 6, 2020 at 5:00 am #1474435David
Resolved.October 6, 2020 at 5:52 am #1474489DavidStaffCustomer SupportFebruary 5, 2021 at 6:38 am #1646855Robert
Hi David, (am trying to contact the original question setter)
I am looking to do the same thing (adding Hreflang tags) to my own website. I wondered if you could explain how you did it?
Did you need to create a new element for each page/post?
I am doing it within one domain not two sites but think otherwise it is the same.
I hope to hear from you.
RobFebruary 5, 2021 at 7:32 am #1647124DavidStaffCustomer Support
no need for multiple Elements.
For each Element you can set any number of Display Rules. Or use a single display rule that covers your needs.
For example the
Entire Sitedisplay location will cover the entire site. This would be Global scope.
Or a wide scope Display Rule could be
Posts > All Posts
You can match Locations with Exclusions. For example: Location: Entire Site and Exclude: Page > A specific page.February 5, 2021 at 8:40 am #1647212Robert
Thank you for your reply. I was expecting from the other David that first posted but Im sure you can still help, thank you.
I am looking to use Hreflang tag which is for telling Google about alternative pages in different languages. I therefore have to reference specific pages (the alternative languages) within the element.
I think I therefore need a new element for each page that is then located in the ‘head’ of each language version of that page, which I can do using the drop down options.
I have done this and it seems to work.
My question is:
If I have lots of elements, (if I translate 100+ pages this would require 100+ Hook Element) will it slow down the whole website or just the slow the pages where the Element is applied?
Do you know of a better method?
RobFebruary 5, 2021 at 1:36 pm #1647493DavidStaffCustomer SupportFebruary 5, 2021 at 1:55 pm #1647507Robert
I am just doing it using the hook element to avoid another plugin.
Maybe not saving anything?
ThanksFebruary 5, 2021 at 2:05 pm #1647518DavidStaffCustomer Support
Hmmm…. it would be good if there was a way of identifying the language such as Taxonomy term. Are the foreign language posts in a separate category or ? If so then you can use the Post Category or Post Tags display rule.
If there is no specific category/tag term – then you can register a custom taxonomy for your display rules – see this topic:April 12, 2021 at 11:51 am #1731670TheSalvadorDaliOfWebsites
I hope this is relevant to the thread: I am attempting to add <html lang=”da”> to improve hyphenation / line-breaking on a Danish language site I am working on.
I created a hook like so:
Elements > create new hook > <html lang=”da”>
Settings: Hook > wp_head
Display rules: Location > Entire Site
Is this the proper way to get a tag to display inside the HTML tag?
Thanks in advance.April 12, 2021 at 11:53 am #1731673LeoStaffCustomer SupportApril 12, 2021 at 1:47 pm #1731751TheSalvadorDaliOfWebsites
Good to hear. I am seeing it also in the source code of my page, so the hook is working.
But: very first line of code in the page source is
Is there a function in GeneratePress to change this to, for example, Danish?April 12, 2021 at 1:51 pm #1731755TheSalvadorDaliOfWebsites
The answer to my own question:
Wordpress dashboard > Settings > General > Site LanguageApril 12, 2021 at 2:01 pm #1731760TheSalvadorDaliOfWebsites
And if you don’t want the WP Dashboard language to change along with the site language, you can set a custom language for each user under the user preferences in WP Dashboard.
- You must be logged in to reply to this topic.