The page slug for each of our wordpress articles is a unique set of seven digits, and we are using that string of numbers as the page slug.
In trying to learn how to customize our site even further, I'd like to learn how to echo that slug in template files (outside the loop - it would actually be used in the sidebar). Here's what I've tried so far (and failed miserably):
At the top of the post template file, I have this code:
<?php $doi = get_page_template_slug( $post_id ); ?>
So I'm trying to create a $doi variable that has the page slug.
Later on in the template file, I'm trying to echo that variable:
<?php echo $doi; ?>
That also fails. Anyone got time to help a PHP newbie out?
$slug
variable. Then you should be able to use it as you're attempting to use$doi
in your question.