PHP Code / Wordpress Syntax Problem
Posted: Tue Mar 22, 2011 8:22 am
I am new to PHP and new to Wordpress so have a steep learning curve ahead of me.
I have what appears to be a simple issue I just can not crack. All I have trying to do is show a page title or not depening on the page within a Wordpress I am looking at. I am using the is_home statement so it should be simple but I am getting an error, I suspect because my syntax is incorrect. This is what I am trying to do
I tried it like this but then got the error
It seems like it should be easy but can anyone give me a steer on this.
I have what appears to be a simple issue I just can not crack. All I have trying to do is show a page title or not depening on the page within a Wordpress I am looking at. I am using the is_home statement so it should be simple but I am getting an error, I suspect because my syntax is incorrect. This is what I am trying to do
Code: Select all
<?php
if ( is_home() ) {
// If this is the home I do not want to show anything
} else {
// If this is not the home page then I want to show the page title.
}
?>Code: Select all
<?php
if ( is_home() ) {
} else {
<h2><?php the_title(); ?></h2>
}
?>