accessing global variables
-
WordPress is installed at https://www.mydomain.com/wordpress/
On the comments.php page (which shows up on https://www.mydomain.com/wordpress/permalink/, I added the code:
<?php global $user_ID; echo('User ID: ' . $user_ID); ?>
Which, when a user is logged in, properly displays their User ID.
I have another page at https://www.mydomain.com/somewhere_else/
I added the code:<?php global $user_ID; echo('User ID: ' . $user_ID); ?>
This does not work as it did above. I presume it is because it is on a page not within the wordpress installation.
How can I get it to work?
Thanks,
~marc
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘accessing global variables’ is closed to new replies.