Wordpress: can you identify page name in variable?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Wordpress: can you identify page name in variable?

Post by simonmlewis »

We have a WP website where there is a background image set via the theme. But we want to disable it for the homepage.
I don't see a theme means of doing that, so thought I might use the "insert php" plugin.

Trouble is, I can only see the best way to achieve this is to query what page I Am on, and if on "homepage", then to echo a bit of CSS to set the background image to be none.

But how do I identify the "homepage" in a Wordpress site? I don't know what variable's it uses to query the $page.

Any ideas?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Wordpress: can you identify page name in variable?

Post by Celauran »

simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Wordpress: can you identify page name in variable?

Post by simonmlewis »

That's it. Thanks.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply