Hi,
I’m struggling to isolate my front page for some separate styling.
I would like to use some conditional logic `<?php is_front_page(); ?>’
to change the colour of the transparent content area, but only on the front page. I have run a test (‘this is the front page’) but it shows on all pages. I am using a customised child version of page.php.
Ok I’m thinking now that I need to paste all the existing code from page.php into the ‘if’ part of the conditional statement
with the only change being the addition of a style declaration (custom-bg-site-content-color) to change the colour of the site-content area only on the front page thus:
Unfortunately is_home and is_front_page do nothing
Thanks for the tip on getting the php open and close sequence right, despite resolving these statements I couldn’t get any action on conditionally isolating the home page.
Found an answer to this: http://codex.wordpress.org/Function_Reference/body_class
Found this in the source: <body class="home page page-id-255 page-child parent-pageid-30 page-template-default logged-in admin-bar no-customize-support single-author">
So I just found the relevant div I wanted to style and did this: .home div#content.site-content { background-color: rgba(235, 128, 171, 0.50); }
Thanks for your help, you put me on the right track when you mentioned setting a class.