Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 4 years ago.
Improve this questionI think either I am quite stupid today or just work-blind by this project but I've been trying to fix a little error a new shortcode is causing.
This is the code
<?php function reviewslide_function() {
$output .= '
<!-- Review Injection -->
<div id="reviews" class="p-full">
<div class="section_head">
<span class="eyebrow">You about us</span>
<h2>Customer Reviews</h2>
</div>
<div class="stars">
<span class="material-icons">grade</span>
<span class="material-icons">grade</span>
<span class="material-icons">grade</span>
<span class="material-icons">grade</span>
<span class="material-icons">grade</span>
</div>
<div id="reviewbox">';
$args = array(
'post_type' => 'review',
'posts_per_page' => 5,
'order' => 'DESC',
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$output .= '
<div class="review">'.
the_content().
'<span class="review_author">'.
bewerter_get_meta( "bewerter_name" ).
'</span></div>';
enwhile;
$output .= '
</div>
<script>jQuery("#reviewbox > div:gt(0)").hide();
setInterval(function() {
jQuery("#reviewbox > div:first")
.fadeOut(1800)
.next()
.fadeIn(2000)
.end()
.appendTo("#reviewbox");
}, 6000);
</script>
<div class="reviewbtn btn btn_blue arrow_r nosmooth">
<a href="~GOOGLEREVIEWLINK~" target="_blank"><span>All Reviews</span></a>
</div>
</div>
<!-- Review Exit -->';
return $output;
}
add_shortcode('reviews', 'reviewslide_function'); ?>
This is the error thrown at me:
Parse error: syntax error, unexpected '}' in /html/wordpress-dev/wp-content/plugins/cpt-review/index.php on line 187
I am getting mad crazy trying to fix this, I just seem to be unable to find the error in here.
Closed. This question is off-topic. It is not currently accepting answers.Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 4 years ago.
Improve this questionI think either I am quite stupid today or just work-blind by this project but I've been trying to fix a little error a new shortcode is causing.
This is the code
<?php function reviewslide_function() {
$output .= '
<!-- Review Injection -->
<div id="reviews" class="p-full">
<div class="section_head">
<span class="eyebrow">You about us</span>
<h2>Customer Reviews</h2>
</div>
<div class="stars">
<span class="material-icons">grade</span>
<span class="material-icons">grade</span>
<span class="material-icons">grade</span>
<span class="material-icons">grade</span>
<span class="material-icons">grade</span>
</div>
<div id="reviewbox">';
$args = array(
'post_type' => 'review',
'posts_per_page' => 5,
'order' => 'DESC',
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$output .= '
<div class="review">'.
the_content().
'<span class="review_author">'.
bewerter_get_meta( "bewerter_name" ).
'</span></div>';
enwhile;
$output .= '
</div>
<script>jQuery("#reviewbox > div:gt(0)").hide();
setInterval(function() {
jQuery("#reviewbox > div:first")
.fadeOut(1800)
.next()
.fadeIn(2000)
.end()
.appendTo("#reviewbox");
}, 6000);
</script>
<div class="reviewbtn btn btn_blue arrow_r nosmooth">
<a href="~GOOGLEREVIEWLINK~" target="_blank"><span>All Reviews</span></a>
</div>
</div>
<!-- Review Exit -->';
return $output;
}
add_shortcode('reviews', 'reviewslide_function'); ?>
This is the error thrown at me:
Parse error: syntax error, unexpected '}' in /html/wordpress-dev/wp-content/plugins/cpt-review/index.php on line 187
I am getting mad crazy trying to fix this, I just seem to be unable to find the error in here.
Share Improve this question asked Oct 5, 2020 at 11:24 marvinpoomarvinpoo 3033 silver badges18 bronze badges 3 |1 Answer
Reset to default 3You have a typo in your code (enwhile
instead of endwhile
) so PHP is complaining because of non-closed while
loop. Correct it and everything should be ok.
enwhile
typo toendwhile
and everything should be ok. – Ivan Shatsky Commented Oct 5, 2020 at 11:37