Skip to content

Instantly share code, notes, and snippets.

@blueprintmrk
blueprintmrk / disable_transient_caching.php
Created October 3, 2020 21:34 — forked from tacoverdo/disable_transient_caching.php
Disable WordPress SEO transient caching
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/**
* Disables the XML Sitemap transient caching in WordPress SEO and WordPress SEO Premium.
* WARNING: This may lead to a heavier load on your server and your sitemaps being loaded less fast.
*/
add_filter( 'wpseo_enable_xml_sitemap_transient_caching', '__return_false' );
@blueprintmrk
blueprintmrk / yoast_seo_breadcrumbs_replace_woocommerce.php
Created October 3, 2020 21:33 — forked from tacoverdo/yoast_seo_breadcrumbs_replace_woocommerce.php
There are two sets of code in this gist. One for non-WooThemes and one for WooThemes. Only copy the section you need to replace breadcrumbs
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Replace WooCommerce Breadcrumbs With Yoast Breadcrumbs
* Credit: Unknown
* Last Tested: Jan 25, 2018 using Yoast SEO 6.2 on WordPress 4.9.2
* Theme: Non-WooThemes like Twenty Seventeen, Genesis
*/
// Remove WooCommerce Breadcrumbs
{% when 'page' %}
<li>
<a href="{{ page.url }}" aria-current="page">{{ page.title }}</a>
</li>
{% assign t = template | split: '.' | first %}
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ol>
<li>
<a href="/" title="Home">Home</a>
</li>
{% case t %}
{% when 'page' %}
@blueprintmrk
blueprintmrk / settings_schema.json
Created September 11, 2020 17:34 — forked from shopifypartners/settings_schema.json
Theme settings to show and hide accessible breadcrumb snippet - https://www.shopify.com/partners/blog/breadcrumb-navigation
{
"name": "Navigation",
"settings": [
{
"type": "checkbox",
"id": "show_breadcrumb_nav",
"label": "Show breadcrumb navigation"
}
]
},
{% if settings.show_breadcrumb_nav %}
{% include 'breadcrumbs' %}
{% endif %}
.breadcrumbs {
font-size: .85em;
margin: 0 0 2em;
}
.breadcrumbs ol {
list-style-type: none;
margin: 0;
padding: 0;
}
{% unless template == 'index' or template == 'cart' or template == 'list-collections' or template == '404' %}
{% assign t = template | split: '.' | first %}
<nav class="breadcrumbs" role="navigation" aria-label="breadcrumbs">
<ol>
<li>
<a href="/" title="Home">Home</a>
</li>
@blueprintmrk
blueprintmrk / accessible-breadcrumbs-unless.liquid
Created September 11, 2020 17:34 — forked from shopifypartners/accessible-breadcrumbs-unless.liquid
Exclude breadcrumb snippet from rendering on specific templates using unless statement - https://www.shopify.com/partners/blog/breadcrumb-navigation
{% unless template == 'index' or template == 'cart' or template == 'list-collections' or template == '404' %}
{% comment %} snippet code goes here {% endcomment %}
{% endunless %}
{% when 'article' %}
<li>{{ blog.title | link_to: blog.url }}</li>
<li>
<a href="{{ article.url }}" aria-current="page">{{ article.title }}</a>
</li>