WordPress.org

Ready to get started?Download WordPress

Forums

Wrap function in align and font specifications (6 posts)

  1. dml3001
    Member
    Posted 2 years ago #

    I'm not sure why this code isn't working, I've tried with inserting echo $date as well and nothing.

    <?php
    
    $date = the_date('l - F jS', '<h2>', '</h2>');
    
    	<div align="center"><font color=\"#FF00FF\"><$date></font></div>
    
    ?>
  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Try using <?php echo $date;?>

  3. dml3001
    Member
    Posted 2 years ago #

    It breaks every time I put a <?php ?> within a <?php ?>.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    <?php $date = the_date('l - F jS', '<h2>', '</h2>');?>
    <div class="aligncenter purple"><?php echo $date;?></div>
  5. dml3001
    Member
    Posted 2 years ago #

    This code prints the date as formatted in the first line, but it seems that it does not recognize the second.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    <?php $mydate = get_the_date('l - F jS', '<h2>', '</h2>');?>
    <div class="aligncenter purple"><?php echo $mydate;?></div>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags