[resolved] php if code (3 posts)

  1. jrcollins
    Posted 2 years ago #

    I'm trying to show the date on the front page of my website using the following code:

    <?php if(is_front_page()) ?>
      <p id="update"><?php the_date('M d Y'); ?></p>
    <?php endif ?>

    but I'm getting an "unexpected t_endif" error.
    Can someone who knows what they're doing tell me what I'm doing wrong?

  2. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

  3. jrcollins
    Posted 2 years ago #

    Hi, thanks for the link. That worked! I changed it to the following:

    <?php if(is_front_page()): ?>
    <p id="update"><?php the_date('M d Y'); ?></p><?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic