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!
Could you provide more specific information?
What theme are you using? Which WP version? Your code? URL?
I'm only guessing here: Does your sidebar.php reference a style sheet that header.php does not?
I could not find any $id or get_the_ID anywhere in my sidebar/footer/header.php on my site. Or are you referring to a string?
SMILE: You're on camera!
Thanks Ripose, I post new new thread here:
http://wordpress.org/support/topic/200320?replies=1
Looking forward to your tips :)
i was looking the get_the_ID() too, but there is no such function. sorry.
sorry, here is the source of post-template.php:
7 function the_ID() {
8 global $id;
9 echo $id;
10 }
11
12
13 function get_the_ID() {
14 global $id;
15 return $id;
16 }