Title: How adding shortcode to header.php
Last modified: April 1, 2020

---

# How adding shortcode to header.php

 *  Resolved [lynnykwork](https://wordpress.org/support/users/lynnykwork/)
 * (@lynnykwork)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/help-adding-to-header-php/)
 * 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 6 years, 2 months ago by [lynnykwork](https://wordpress.org/support/users/lynnykwork/).
    -  This topic was modified 6 years, 2 months ago by [lynnykwork](https://wordpress.org/support/users/lynnykwork/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Noah Hearle](https://wordpress.org/support/users/designextreme/)
 * (@designextreme)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/help-adding-to-header-php/#post-12614430)
 * [@lynnykwork](https://wordpress.org/support/users/lynnykwork/) When you add a
   shortcode to a PHP file you need to use the WordPress function: `do_shortcode()`
 *  Thread Starter [lynnykwork](https://wordpress.org/support/users/lynnykwork/)
 * (@lynnykwork)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/help-adding-to-header-php/#post-12614536)
 * Why is my topic status “Resolved”? I have not yet received an answer to my question.
 *  Plugin Author [Noah Hearle](https://wordpress.org/support/users/designextreme/)
 * (@designextreme)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/help-adding-to-header-php/#post-12616056)
 * [@lynnykwork](https://wordpress.org/support/users/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 6 years, 2 months ago by [Noah Hearle](https://wordpress.org/support/users/designextreme/).
      Reason: Clarified echo
    -  This reply was modified 6 years, 2 months ago by [Yui](https://wordpress.org/support/users/fierevere/).
 *  Plugin Author [Noah Hearle](https://wordpress.org/support/users/designextreme/)
 * (@designextreme)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/help-adding-to-header-php/#post-12616288)
 * [@lynnykwork](https://wordpress.org/support/users/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 [Noah Hearle](https://wordpress.org/support/users/designextreme/)
 * (@designextreme)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/help-adding-to-header-php/#post-12617337)
 * [@lynnykwork](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/g-business-reviews-rating/assets/icon.svg?rev=2722684)
 * [Reviews and Rating – Google Reviews](https://wordpress.org/plugins/g-business-reviews-rating/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/g-business-reviews-rating/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/g-business-reviews-rating/)
 * [Active Topics](https://wordpress.org/support/plugin/g-business-reviews-rating/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/g-business-reviews-rating/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/g-business-reviews-rating/reviews/)

## Tags

 * [do_shortcode](https://wordpress.org/support/topic-tag/do_shortcode/)
 * [header](https://wordpress.org/support/topic-tag/header/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 5 replies
 * 2 participants
 * Last reply from: [Noah Hearle](https://wordpress.org/support/users/designextreme/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/help-adding-to-header-php/#post-12617337)
 * Status: resolved