• I’m using the “recent posts” plugin and it’s working. I have the Title and an excerpt of the post at the bottom of my homepage. I would like to add the date of the post after the title and I can’t get it in place.

    Here is the part of the code that needs modifying:

    $output .= $before . '<font size="3" face="Georgia, Lucida Sans, Tahoma"><a href="' . $permalink . '" rel="bookmark" title="Permanent Link: ' . $post_title . '">' . $post_title . '</a></font>';

    I’ve been trying to add this code after the $post_title:

    `<?php the_date(”,'<h2>’,'</h2>’); ?>’

    into the above code but haven’t had any success.

    Any help would be appreciated.

Viewing 1 replies (of 1 total)
  • First off, I’d copy the line of code, paste in a duplicate and comment out the duplicate line so you can go back without any problems. It’s always easier to remove the comment markers than to reconstruct code.

    The $output variable is being constructed in php, so there’s no need to include the “<?php” or “?>”. Try this for the new line:

    $output .= $before . '<font size="3" face="Georgia, Lucida Sans, Tahoma"><a href="' . $permalink . '" rel="bookmark" title="Permanent Link: ' . $post_title . '">' . $post_title . ' ' . the_date("","<h2>","</h2>") . '</a></font>';

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Date to Post Title’ is closed to new replies.