WordPress.org

Support

Support » How-To and Troubleshooting » Wrap function in align and font specifications

Wrap function in align and font specifications

  • 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>
    
    ?>
Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi
    Forum Moderator

    @esmi

    Try using <?php echo $date;?>

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

    esmi
    Forum Moderator

    @esmi

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

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

    esmi
    Forum Moderator

    @esmi

    <?php $mydate = get_the_date('l - F jS', '<h2>', '</h2>');?>
    <div class="aligncenter purple"><?php echo $mydate;?></div>
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Wrap function in align and font specifications’ is closed to new replies.