Add Yelp Reviews to a page in my Store

New Member
10 0 0

I am trying to add my Yelp Reviews to my testimonials page in my store.

I put the following code right before </head> in the theme.liquid

  {% if page_title == testimonials %}
  <script>(function() { var s = document.createElement("script");s.async = true;s.onload = s.onreadystatechange = function(){getYelpWidget("fredas-kitchen-austin","300","RED","y","y","3");};s.src='http://chrisawren.com/widgets/yelp/yelpv2.js' ;var x = document.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);})();</script>
  {% endif %}

And then on the testimonials page I put:

<div id="yelpwidget"></div>

But nothing shows up.

Any help would be greatly appreciated.

 

thanks!

0 Likes
Shopify Expert
244 0 38

I'm new to liquid, but I suspect you need quotes around your page_title check. e.g.

{% if page_title == "testimonials" %}

 

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
Shopify Staff (Retired)
Shopify Staff (Retired)
269 1 20

Hi Michell,

Stephanie here from Shopify's guru team. 

I am going to move your post to our design forum as I feel you will get more help with this over there!

I can also offer the following recommendations:

1. If you are utilizing a Shopify supported theme, we can have our theme support team add a social icon for Yelp on your site. 

2. Alternatively, you could create a menu item for "Yelp" on your main menu, and set it to link to your Yelp page. In order to do this, you would have to configure your navigation like this:

Hope this helps! Of course, if you would like to have our theme support team make this change for you; feel free to reach out to support@shopify.com with your request!

 

-Stephanie

Stephanie | Shopify Support
0 Likes
New Member
10 0 0

Thanks Stephanie. However, we want the actual reviews to show up on our website.

0 Likes
New Member
10 0 0

Thank Tony. No luck. :(

0 Likes
Highlighted
Shopify Expert
244 0 38

I noticed the pages title does not exactly match "testimonials". It has to be exact, including the case of the letters. 

 

I think you are also using the wrong parameter. page_title refers to the SEO title tag of a page, not it's heading. pag.title is the heading.

This may work better:

{% if page.title == "Testimonials" %}

 

It would be more reliable to use page.id, as the title may change, but I'm not sure how to find out the id without hacking in some test code to display it.

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
New Member
10 0 0

Thank you. Unfortuntaley still not working. Do you think the code needs to be in the <head> section or the <body> section?

0 Likes
Shopify Expert
244 0 38

I'm new to Liquid, so this may be all wrong.

I would do a test. like this:

<meta name="page.title" content="{{ page.title }}" />

<meta name="page.id" content="{{ page.id }}" />

Then look at the source code for the page and find out what content is set to. That is what your if check has to match exactly. 

Technical SEO Consultant - Specialising in setting up Structured Data for Rich Snippets, Google Analytics for advanced reports and the Google Search Console for efficient crawling.
0 Likes
New Member
5 0 0

Hello,

We created Yelp Widget for https://apps.shopify.com/yelp 
Easy installation and usage with a lot features!

If you have any ideas of adding a new features to this app, just let me to know ;)

--
Roman Ananev
rananev@simtechdev.com

Roman Ananev, Simtechdev PM manager. https://apps.shopify.com/partners/simtechdev
0 Likes