This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showAuthorInitials(containerSelector, blockSelector, attribute) { | |
const container = document.querySelector(containerSelector); | |
const blocks = container.querySelectorAll(blockSelector); | |
for (let i = 0; i < blocks.length; i++) { | |
const block = blocks[i]; | |
const value = block.getAttribute(attribute); | |
const words = value.split(" "); | |
let initials = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% javascript %} | |
function loadSection() { | |
var elArray = Array.prototype.slice.call(document.querySelectorAll(".shopify-section-ab")); | |
if (window.parent.ThemeEditor !== undefined) { | |
elArray.forEach(function(el) { | |
el.classList.remove("ssab-neither"); | |
el.classList.add("ssab-editor"); | |
}); | |
} else { | |
var cookie = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- comment -%} | |
@param before_readmore {Boolean} | |
Output the contents of the text before the readmore shortcode | |
{%- endcomment -%} | |
{%- assign readmore_split = text | split: '<!-- more -->' -%} | |
{%- if before_readmore -%}{{- readmore_split[0] -}}{%- else -%}{{- readmore_split[1] -}}{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for image in product.media %} | |
<img src="{{ image.preview_image | img_url: '900x' }}" alt="{{ image.alt | default: product.title | strip_html | escape }}"> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Article structured data | |
https://developers.google.com/search/docs/data-types/articles | |
{% endcomment %} | |
{% if template contains 'article' %} | |
{%- capture article_description -%} | |
{%- if article.excerpt != blank -%} | |
{{ article.excerpt | strip_html }} | |
{%- else -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function delete_404_attachments(){ | |
$attachments = get_posts( array( | |
'post_type' => 'attachment', | |
'numberposts' => -1, | |
'fields' => 'ids' | |
)); | |
if ($attachments) { | |
foreach ($attachments as $attachmentID){ | |
$file_url = wp_get_attachment_url( $attachmentID); | |
$file_headers = @get_headers($file_url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- if article.image -%} | |
<div class="article-template__hero-container" {{ block.shopify_attributes }}> | |
<div class="article-template__hero-{{ block.settings.image_height }} media" | |
itemprop="image" | |
{% if block.settings.image_height == 'adapt' and article.image %} style="padding-bottom: {{ 1 | divided_by: article.image.aspect_ratio | times: 100 }}%;"{% endif %} | |
> | |
<img | |
srcset="{% if article.image.width >= 350 %}{{ article.image | img_url: '350x' }} 350w,{% endif %} | |
{% if article.image.width >= 750 %}{{ article.image | img_url: '750x' }} 750w,{% endif %} | |
{% if article.image.width >= 1100 %}{{ article.image | img_url: '1100x' }} 1100w,{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var _learnq = _learnq || []; | |
var item = { | |
Name: {{ product.title|json }}, | |
ProductID: {{ product.id|json }}, | |
Categories: {{ product.collections|map:'title'|json }}, | |
ImageURL: "https:{{ product.featured_image.src|img_url:'grande' }}", | |
URL: "{{ shop.secure_url }}{{ product.url }}", | |
Brand: {{ product.vendor|json }}, | |
Price: {{ product.price|money|json }}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Anti-flicker snippet (recommended) --> | |
<style>.async-hide { | |
opacity: 0 !important | |
} </style> | |
<script> | |
(function (a, s, y, n, c, h, i, d, e) { | |
s.className += ' ' + y; | |
h.start = 1 * new Date; | |
h.end = i = function () { | |
s.className = s.className.replace(RegExp(' ?' + y), '') |
NewerOlder