Hi, I have WordPress blog where I slightly customized the theme. I now have the following HTML fragment inside header.php: <div class="container11" > <div class="row" id="header" > <div class="column12 alpha" id="header-1" > <h1>Some nice header text</h1> <h2>Some other text</h2> </div> <div class="column3 omega" id="header-2"></div> </div> </div> Instead, I need to have the following behavior: if the header is loaded in the homepage or in the post I need to have "<h2>some text that is good for posts or homepage"</h2> and if it is loaded in the page (as opposed to post) I need to have <h2>some text that is good for pages"</h2> I know that it is really easy to do with PHP but don't have time to recall it or to look up. The first person, who posts an answer (i.e. code fragment that works after I replace with it the HTML fragment above), will receive $10 "thank you" payment over PayPal. Thanks all, Jeff
<div class="container11" > <div class="row" id="header" > <div class="column12 alpha" id="header-1" > <h1>Some nice header text</h1> <?php if ( is_page() ) echo '<h2>some text that is good for pages</h2>'; elseif ( is_home() || is_single() ) echo '<h2>some text that is good for posts or homepage</h2>'; ?> </div> <div class="column3 omega" id="header-2"></div> </div> </div> PHP: my paypal id:
Thank You. Your code worked fine, so I will send "thank you" payment to you. The "contest" is now closed.