Support » Fixing WordPress » get_the_ID() and $id Are not available in header.php, how can I get it?

  • How can I get the post id in the header.php?

    It seems that the $id or get_the_ID can only be available in sidebar.php / footer.php but NOT in header.php

    Maybe it’s due to the header “doesn’t know” the id 🙂

    But how can I just get my ID in a header.php? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘get_the_ID() and $id Are not available in header.php, how can I get it?’ is closed to new replies.