Help customising :)
-
Hi Lester
I’m trying to customise how the plugin displays, but I’ve ran into a bit a problem I don’t know how to fix 🙂
In the comments template instead of using :
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>I want to use this :
<?php global $current_user, $post; $user_comment_count = get_comments(array('user_id' => $current_user->ID, 'post_id'=>$post->ID) ); ?> <?php if($user_comment_count) { echo '<h2>Thank you for your review, please leave a star rating.</h2>'; the_ratings(); } else { echo' <h2>Leave a review first you may then give a star rating.</h2>'; comment_form(array('class_submit'=>'button')); } ?>Which basically hides the rating, until a comment has been made. This works just fine and as expected, however when doing this, the JSON-LD doesnt output and so when using the https://search.google.com/structured-data/testing-tool/u/0/
It doesnt show any schema, if i revert back to the original code it works fine.
Please could you advise where im going wrong.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Help customising :)’ is closed to new replies.