• I hope this is the right section. I’m trying to do

    <?php
      if(is_page()); {
    <h1><?php the_title(); ?></h1>
    }  else {
    <h1>Text HERE</h1>
    }

    But it keeps giving me an “unexpected < at…” error. What am I doing wrong?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • <?php if(is_page()); { ?>
    <h1><?php the_title(); ?></h1>
    <?php } else { ?>
    <h1>Text HERE</h1>
    <?php } ?>

    Thread Starter bsd13

    (@bsd13)

    Thanks for replying but didn’t work. Now I’m getting “Parse error: syntax error, unexpected T_ELSE” I can make the is_page(); function just fine, but as soon as I go beyond that I run into errors.

    if(is_page()); {

    remove the ;

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP nesting problem’ is closed to new replies.