I have two (similar) templates in this page.
I created the first template on the left, i exported the template, i reinserted in to create similar one (the one on the right noted area).
I then made a small change on the second template (adding the green top-botton border) and for some strange reason, the first template on the left is also affected.
I have no global css class appointed to any of the containers user for the first and the second template.
This is the most strange thing !!
Any solution to this and reason why is it happening ?
That is how it is meant to behave as they are global templates. However for templates not to act this way, first include the template element and then select it that way. It will then not alter other areas where the template has been included.
This is the way i used to import them in the page, with the “template” widget.
But, they are supposed to be two different templates and not the same.
this is why i exported the first one and reimported it, renamed it and then changed style.
This is the meaning of Templates, to change simultaneously in many places.
BUT, here we are not talking about the same template…
I have one template, i export it to a JSON file, i import it again as a second template and then when i make changes to the second template, the first one changes too…
Perhaps it is something with either the naming convention or sharing duplicate IDs. So when you change one because the ID is the same as the one you have imported, it changes the styles on both?
But I think it is hard to know for sure without inspecting both templates and seeing if they do match or not.
I just noticed the URL and checked the shortcode and they are using the same class - please see image:
Hi Yannis,
the problem is not the templates, but the loop used in them.
Because you duplicated the template (incl. loop), the loop has the same ID in both cases, which becomes a class in the case of the loop. You can also see this if you look at the source code on your page.