I’m trying to use this in a template file that auto-generates a post when someone uploads an image. The post slug is to be utilized as a link to the image post itself, so that when the image is clicked on via the homepage, it takes you to the image post as you would expect. When I use the code provided here nothing is returned. Any ideas as to why? I tried what Frankie said and it came up blank, but I’m outside The Loop and I believe that global $post requires you be inside The Loop. Then I tried Chris’s code and it STILL comes up blank. *sigh*
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘get current page slug outside the loop’ is closed to new replies.