Title: PHP question
Last modified: August 18, 2016

---

# PHP question

 *  [basketball](https://wordpress.org/support/users/basketball/)
 * (@basketball)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/php-question/)
 * Can someone help me get this line of php code working:
    ` function get_recent_posts(
   $no_posts = 5, $before = '<li>', $after = '</li><small>Posted on <?php the_time('
   F jS, Y') ?> at <?php the_time('g:i a') ?>&nbsp; | Comments: <?php comments_popup_link(
   __('(0)'), __('(1)'), __('(%)')); ?></small>', $show_pass_post = false, $skip_posts
   = 0) {
 * Just that part where it says &after = ‘ ‘ Everytime I add that php_the_time part
   it gives me the following error;
    ` Parse error: parse error, unexpected T_STRING,
   expecting ')' in /home/bball2/public_html/site/my-hacks.php on line 2

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

 *  Thread Starter [basketball](https://wordpress.org/support/users/basketball/)
 * (@basketball)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/php-question/#post-168917)
 * Anyone?
 *  [Beel](https://wordpress.org/support/users/beel/)
 * (@beel)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/php-question/#post-168920)
 * Yeah, two things – can’t have `<?php ?>` in the function for one. For the other,
   don’t thing the_time would work here anyway.
 *  Thread Starter [basketball](https://wordpress.org/support/users/basketball/)
 * (@basketball)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/php-question/#post-168922)
 * Dang, that’s too bad. Then does anyone have any ideas where I can have a list
   a list of the last 5 or 6 posts along with it’s dates and number of comments 
   and the title of course.
 *  [Beel](https://wordpress.org/support/users/beel/)
 * (@beel)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/php-question/#post-168929)
 * If you are using the old my-hacks function I think you are using, you can modify
   the function. As I recall it pulled the id and post_title out of the database.
   You will have to add post_date and use maybe:
    $blah = $post->post_date; and 
   then manipulate it however you want.
 *  Thread Starter [basketball](https://wordpress.org/support/users/basketball/)
 * (@basketball)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/php-question/#post-168932)
 * Thanks for the help Beel but I got lucky and stumbled onto what is slowly becoming
   one of my favourite WP plugins.
 * [http://www.coffee2code.com/archives/2004/08/27/plugin-customizable-post-listings/](http://www.coffee2code.com/archives/2004/08/27/plugin-customizable-post-listings/)
 * It does EVERYTHING!
 *  [Beel](https://wordpress.org/support/users/beel/)
 * (@beel)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/php-question/#post-169098)
 * Good. I also happen to use Scott’s plugin for an upcoming events page for a site
   I am working on:
    [http://www.billhayes.us/~stjohns/parish-activities](http://www.billhayes.us/~stjohns/parish-activities)

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

The topic ‘PHP question’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Beel](https://wordpress.org/support/users/beel/)
 * Last activity: [21 years, 2 months ago](https://wordpress.org/support/topic/php-question/#post-169098)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
