Skip to content

Commit cdd36b6

Browse files
authored
ADD: star rating widget. [1]
1 parent 3ecd980 commit cdd36b6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

layout/_third-party/rating.swig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% if theme.rating.enable and (not is_home() and is_post()) %}
2+
<script type="text/javascript">
3+
wpac_init = window.wpac_init || [];
4+
wpac_init.push({widget: 'Rating', id: {{ theme.rating.id }},
5+
el: 'wpac-rating',
6+
color: '{{ theme.rating.color }}'
7+
});
8+
(function() {
9+
if ('WIDGETPACK_LOADED' in window) return;
10+
WIDGETPACK_LOADED = true;
11+
var mc = document.createElement('script');
12+
mc.type = 'text/javascript';
13+
mc.async = true;
14+
mc.src = '//embed.widgetpack.com/widget.js';
15+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(mc, s.nextSibling);
16+
})();
17+
</script>
18+
{% endif %}

0 commit comments

Comments
 (0)