WPIntell

Source evidence

Adding a PHP Code Snippet not working > Parse Error

OpenHook · support · 2015-05-29T00:48:00+00:00

complaintsentiment
mediumseverity
0.87relevance
1replies
Evidence onlycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 1 rows with source links

100.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

0 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
ksteele36 unresolved
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/ https://wordpress.org/plugins/thesis-openhook/ 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.

Comments

1 shown
Rick Beckman 2015-05-29T21:20:00+00:00

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.