Title: parse error in my-hacks.php
Last modified: August 18, 2016

---

# parse error in my-hacks.php

 *  [torsten](https://wordpress.org/support/users/torsten/)
 * (@torsten)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/parse-error-in-my-hacksphp/)
 * i want to use the my-hacks-feature, for this i enabled the hack in the admin-
   panel, but whatever code i am putting in the my-hacks.php-file, i get a parse
   error in the second line (after the <php…)
    i am using wp 1.0.2.

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

 *  [prara](https://wordpress.org/support/users/prara/)
 * (@prara)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/parse-error-in-my-hacksphp/#post-52194)
 * I suggest you upgrade to WP1.2 then use the plugin feature. It’s *cooler*
 *  [prara](https://wordpress.org/support/users/prara/)
 * (@prara)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/parse-error-in-my-hacksphp/#post-52195)
 * btw you should use <?php not <php
 *  Thread Starter [torsten](https://wordpress.org/support/users/torsten/)
 * (@torsten)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/parse-error-in-my-hacksphp/#post-52199)
 * yes, i am using <?php…
    i’ll think about upgrading, but i guess i will wait until
   the official version…
 *  [prara](https://wordpress.org/support/users/prara/)
 * (@prara)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/parse-error-in-my-hacksphp/#post-52203)
 * So what’s in the second line?
    I think WP1.2-epsilon-RC1 is *almost* stable. 
   Plus you can help in debugging.
 *  Thread Starter [torsten](https://wordpress.org/support/users/torsten/)
 * (@torsten)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/parse-error-in-my-hacksphp/#post-52222)
 * for example the recent comments hack:
    function get_recent_comments($no_comments
   = 5, $comment_lenth = 5, $before = ‘
    - ‘, $after = ‘
    - ‘, $show_pass_post = false) {
       global $wpdb, $tablecomments, $tableposts; 
      $request = “SELECT ID, comment_ID, comment_content, comment_author FROM $tableposts,
      $tablecomments WHERE $tableposts.ID=$tablecomments.comment_post_ID AND post_status
      = ‘publish’ “; if(!$show_pass_post) { $request .= “AND post_password =” “;}
      $request .= “AND comment_approved = ‘1’ ORDER BY $tablecomments.comment_date
      DESC LIMIT $no_comments”; $comments = $wpdb->get_results($request); $output
      = ”; foreach ($comments as $comment) { $comment_author = stripslashes($comment-
      >comment_author); $comment_content = strip_tags($comment->comment_content);
      $comment_content = stripslashes($comment_content); $words=split(” “,$comment_content);
      $comment_excerpt = join(” “,array_slice($words,0,$comment_lenth)); $permalink
      = get_permalink($comment->ID).”#comment-“.$comment->comment_ID; $output .=
      $before . ‘**‘ . $comment_author . ‘:**  $output .= ‘” title=”View the entire
      comment by ‘ . $comment_author.'”>’ . $comment_excerpt . ‘…‘ . $after; } echo
      $output; } parse error in line 2 (or 3 if i leave the second line blank..)
 *  Anonymous
 * [22 years, 1 month ago](https://wordpress.org/support/topic/parse-error-in-my-hacksphp/#post-52564)
 * I was having the same problem. I found that I had the first line as <? php (Note
   the space after the angle bracket.
    Correcting this to <?php fixed the problem.
   Jacob

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

The topic ‘parse error in my-hacks.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: Anonymous
 * Last activity: [22 years, 1 month ago](https://wordpress.org/support/topic/parse-error-in-my-hacksphp/#post-52564)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
