• Resolved jrswordpress

    (@jrswordpress)


    Hi again Gemini,

    You helped me a year ago incorporating a like-dislike button onto a review template with your plugin at this post:

    https://www.ads-software.com/support/topic/adding-buttons-to-review-template/

    I am trying to incorporate onto a new theme and for some reason, the template won’t load the kodex shortcode with your custom php function. Any suggestion would be greatly appreciated. Thank you.

    My review.php template looks like this:

    <?php defined( ‘WPINC’ ) || die; ?>

    <!DOCTYPE html>
    <html lang=”en”>
    <head>
    <title>Reviews</title>
    <meta charset=”utf-8″>
    <meta name=”viewport” content=”width=device-width, initial-scale=1″>
    </head>

    <section>
    <nav>
    {{ rating }}<h4>
    {{ avatar }}{{ author }} <br><span style=”font-size:17px; vertical-align: middle;”>?</span> Verified Purchase<br>
    {{ date }}</h4>
    </nav>

    <article>
    <h1>{{ title }}</h1>
    <body>
    <h2>{{ content }}</h2> <span style=”display: inline-flex; white-space: nowrap; float: right;”> Was this review helpful? [kodex_post_like_buttons postid=”{{ id }}”]</span>
    <br>

    <p> {{ response }}
    {{ assigned_to }}</p>

    </article>
    </section>
    <hr>

    </body>
    </html>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jrswordpress

    (@jrswordpress)

    Plugin Author Gemini Labs

    (@geminilabs)

    1. First of all, you should not be adding the html/head/body tags to the template. A template is a HTML snippet that is inserted into the body of your page.

    Please see the original /wp-content/plugins/site-reviews/templates/review.php template file to see how it looks like.

    2. Second, you will need to use the do_shortcode function in the template like this:

    <?= do_shortcode('[kodex_post_like_buttons postid='.$review->ID.']'); ?>
    
    
    Thread Starter jrswordpress

    (@jrswordpress)

    Thank you for your guidance, the do shortcode works great! I will try creating a custom div class to style instead of using the html/head/body tags. I would rather have the template coded correctly to run into fewer problems in the future. Thank you again!!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding like dislike button to reviews template’ is closed to new replies.