• Resolved lynnykwork

    (@lynnykwork)


    Firstly thanks for this awesome plugin!
    I’d like to add the small horizontal banner to my header. I want add googgle review-block to header.php. So, I added shortcode to the header.php.
    This is my shortcode:
    [reviews_rating theme=”light center” icon=”false” limit=”0″ count=”true” vicinity=”false”]
    But it doesn’t work. I see only shortcode.
    Could you help me please and to promt how I can add shortcode to php-file?
    P.S: When I set attribute icon=”false” also hided buisness name. I tryed set name=”true” But it didn’t help.
    Thank you!

    • This topic was modified 4 years, 11 months ago by lynnykwork.
    • This topic was modified 4 years, 11 months ago by lynnykwork.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Design Extreme

    (@designextreme)

    @lynnykwork When you add a shortcode to a PHP file you need to use the WordPress function: do_shortcode()

    Thread Starter lynnykwork

    (@lynnykwork)

    Why is my topic status “Resolved”? I have not yet received an answer to my question.

    Plugin Author Design Extreme

    (@designextreme)

    @lynnykwork Specifically, use this PHP code in the header:

    <?php
    do_shortcode('[reviews_rating theme="light center" icon=false limit=0 count=true vicinity=false]');
    ?>

    or (if you want to display it at this place):

    <?php
    echo do_shortcode('[reviews_rating theme="light center" icon=false limit=0 count=true vicinity=false]');
    ?>

    Also, the quotation marks need to be: " not characters – there’s a difference.

    • This reply was modified 4 years, 11 months ago by Design Extreme. Reason: Clarified echo
    • This reply was modified 4 years, 11 months ago by Yui.
    Plugin Author Design Extreme

    (@designextreme)

    @lynnykwork Thanks for spotting the name/icon issue. I will fix this in the next version.

    [reviews_rating name=true icon=false]

    I did make it a requirement for the name to be showing if the icon would also appear, but there’s probably a nice work-around.

    Plugin Author Design Extreme

    (@designextreme)

    @lynnykwork I’ve added a new version – please update to Version 2.19 and the parameters will work as expected in both situations:

    [reviews_rating name=true icon=false]

    [reviews_rating name=false icon=true]

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How adding shortcode to header.php’ is closed to new replies.