Calling whatever variable is assigned to a Page Template
-
Hello all,
I’m trying to give each “section” of my blog a different header image. My plan was to drop something like $section = ‘home’ into the very top of my page_home.php Page Template, and then using an if/than statement to say if $section = ‘home’ show this images, and so on for each different page.
But for some reason, by the time the page loads, it isn’t recognizing the variable anymore.
So I’m wondering if anyone knows how I can find out the variable that WP sets to determine which Page Template it’s using.
For example:
<$php /* Template Name: <strong>Homepage</strong> */ ?>
Is WP setting a variable for homepage here and if so, can I call that variable from another place in my code?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Calling whatever variable is assigned to a Page Template’ is closed to new replies.