[Resolved] Calling whatever variable is assigned to a Page Template
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.
<$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?
- The topic ‘[Resolved] Calling whatever variable is assigned to a Page Template’ is closed to new replies.