Title: Adding a PHP Code Snippet not working &gt; Parse Error
Last modified: August 24, 2016

---

# Adding a PHP Code Snippet not working > Parse Error

 *  [ksteele36](https://wordpress.org/support/users/ksteele36/)
 * (@ksteele36)
 * [11 years ago](https://wordpress.org/support/topic/adding-a-php-code-snippet-not-working-parse-error/)
 * Hi Guys,
    I am having the worst time adding a simple php code snippet to my page…
   I have the [php] enabled in the settings and this is my code I am trying to insert
   into a page:
 *     ```
       <br />
       <?php<br />
       $args = array(<br />
          'post_type' => 'review',<br />
          'post_status' => 'publish',<br />
          'posts_per_page' => -1,<br />
       );</p>
       <p>$all_reviews_query = new WP_Query($args);</p>
       <p>if ($all_reviews_query->have_posts()) {<br />
           while ($all_reviews_query->have_posts()) {<br />
               $all_reviews_query->the_post();<br />
               global $post;<br />
               if ($post->post_type=='accommodation') {<br />
                   $likes = get_post_meta($post->ID, 'review_likes', true);<br />
                   $author = get_the_author();<br />
           ?><br />
                   <!--testimonials--><br />
                   <article class="testimonials clearfix"></p>
       <blockquote><p><?php echo $likes; ?></p></blockquote>
       <p>                <span class="name"><?php echo $author; ?></span><br />
                   </article><br />
                   <!--//testimonials--><br />
       <?php     }<br />
           }<br />
       }<br />
       ?><br />
       ?><br />
       ```
   
 * ————————————————
    The result is a Parse Error: `Parse error: syntax error, unexpected'
   >' in /xxxxxxxx/public_html/dev/wp-content/plugins/thesis-openhook/inc/shortcodes.
   php(28) : eval()'d code on line 2`
 * But I don’t know what that means or how to fix it…. a little help please.
    This
   is the page: [http://dev.bigbearcabinsandrentals.com/reviews/](http://dev.bigbearcabinsandrentals.com/reviews/)
 * [https://wordpress.org/plugins/thesis-openhook/](https://wordpress.org/plugins/thesis-openhook/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Rick Beckman](https://wordpress.org/support/users/brazenlygeek/)
 * (@brazenlygeek)
 * [11 years ago](https://wordpress.org/support/topic/adding-a-php-code-snippet-not-working-parse-error/#post-6178512)
 * You have a lot of `<br />` tags in your code; those will break the PHP; remove
   the ones mixed into the PHP, and you should be fine.

Viewing 1 replies (of 1 total)

The topic ‘Adding a PHP Code Snippet not working > Parse Error’ is closed to new
replies.

 * ![](https://ps.w.org/thesis-openhook/assets/icon.svg?rev=1116483)
 * [OpenHook](https://wordpress.org/plugins/thesis-openhook/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/thesis-openhook/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/thesis-openhook/)
 * [Active Topics](https://wordpress.org/support/plugin/thesis-openhook/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/thesis-openhook/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/thesis-openhook/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Rick Beckman](https://wordpress.org/support/users/brazenlygeek/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/adding-a-php-code-snippet-not-working-parse-error/#post-6178512)
 * Status: not resolved