Function get_the_ID() changes behaviour on child theme
-
This is a very strange issue… One that is even hard to explain.
Imagine a parent theme (in principle, everything work as expected)
Than I add a child theme with only style.css.
In the parent theme I use the function “get_the_ID()”. It doesn’t matter where.
The fact is that if I activate the Parent Theme (completely disregarding the child theme) it correctly tells me the ID of the page I’m visiting (this is true to all pages of the site).
Now, if I activate the child theme (remember that it only has a CSS), the same function gives me a single ID all the time.
I read in various forums that this would be a problem associated with custom queries (WP_Query) that were missing wp_reset_postdata() afterwards.
I don’t think this is the case here, as the child theme is not introducing any PHP. Have you ever see anything like this?
Thanks,
Andres
NowBut if I activate
- The topic ‘Function get_the_ID() changes behaviour on child theme’ is closed to new replies.