Shortcode not working on template
-
Hello,
I’m trying to make the component to be displayed at the end of the recipe steps.
Right now I’m only able to show the component at the end of the_content(); which is not ok for the users.I set the following code on the template where I need the component to be shown but is not working
<?php if ( is_plugin_active( ‘comment-rating-stars/comment-star-reviews.php’ ) ) : ?>
<div class=”recipe-ratings”>
<h3 class=”rating-title”><?php echo esc_html__( ‘RECIPE RATING’, ‘cakeart’ ); ?></h3>
<?php echo csr_get_overall_rating_stars( get_the_ID() ); ?>
<?php $rating_count = csr_get_rating_count( get_the_ID() ); ?>
<?php
if ( $rating_count < 2 ) {
echo ‘( ‘ . $rating_count . esc_html__( ‘ Rating’, ‘cakeart’ ) . ‘ )’;
} else {
echo ‘( ‘ . $rating_count . esc_html__( ‘ Ratings’, ‘cakeart’ ) . ‘ )’;
}
?>
</div>
<?php endif; ?>Could you please advise?
The page I need help with: [log in to see the link]
- The topic ‘Shortcode not working on template’ is closed to new replies.