Weird the_ID error
-
For this example: let’s say I’m on Post with ID 4. In the loop, I have the following line:
echo get_post_meta(the_ID(), 'thisPageIndex', true);
This should echo the content of tag ‘thisPageIndex’ for the post with ID 4. Instead it echoes:
4
If I hard-code the post number in, like this:
echo get_post_meta('4', 'thisPageIndex', true);
It properly echoes the value of the ‘thisPageIndex’ tag.
I can hard code it as number or string and it works fine. I tried wrapping the_ID in an strval() — no dice. Any time I try to call the post’s ID with the_ID, the whole line is overwritten with just the ID number. I can’t figure out what could possible be causing this! HELP!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Weird the_ID error’ is closed to new replies.