Skip to content

Instantly share code, notes, and snippets.

View ihorduchenko's full-sized avatar
💭
Working

Ihor Duchenko ihorduchenko

💭
Working
View GitHub Profile
@ihorduchenko
ihorduchenko / Shopify Script Discounting
Created January 21, 2024 16:09 — forked from jimmijazz/Shopify Script Discounting
Shopify Script Discounting example
# ================================ Customizable Settings ================================
# ================================================================
# Tiered Discounts by Quantity
#
# A list of discount tier offers where:
# - 'product_selector_match_type' determines whether we look for
# products that do or don't match the entered selectors. Can
# be:
# - ':include' to check if the product does match
# - ':exclude' to make sure the product doesn't match
@ihorduchenko
ihorduchenko / desc.php
Created April 16, 2020 11:40 — forked from igorbenic/desc.php
How to Programmatically Change Yoast SEO Open Graph Meta | http://www.ibenic.com/programmatically-change-yoast-seo-open-graph-meta
<?php
function change_yoast_seo_og_meta() {
add_filter( 'wpseo_opengraph_desc', 'change_desc' );
}
function change_desc( $desc ) {
// This article is actually a landing page for an eBook
if( is_singular( 123 ) ) {
@ihorduchenko
ihorduchenko / yoast_seo_prev_next_change.php
Created November 12, 2018 11:20 — forked from amboutwe/yoast_seo_prev_next_change.php
Remove or modify the Yoast SEO prev or next URLs. Only copy the section of code you need.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change Yoast SEO Prev/Next URL on some pages
* Credit: Yoast Team
* Last Tested: Jun 10 2017 using Yoast SEO 4.9 on WordPress 4.8
*/
add_filter( 'wpseo_next_rel_link', 'custom_change_wpseo_next' );
@ihorduchenko
ihorduchenko / collections.liquid.html
Created February 23, 2018 13:49 — forked from rickydazla/collections.liquid.html
"Infinite" (non-auto) scrolling in Shopify collections
{% paginate collection.products by 20 %}
<ul class="collection-matrix">
{% for product in collection.products %}
<li id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</li>
{% endfor %}
<li class="top"><a href="#collectionpage">Back to Top</a> &uarr;</li>
{% if paginate.next %}
<li class="more">&darr; <a href="{{ paginate.next.url }}">More</a></li>
@ihorduchenko
ihorduchenko / custom-date-time-display.php
Created December 14, 2017 14:38 — forked from jo-snips/custom-date-time-display.php
The Events Calendar: Custom Date/Time Display
<?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
<dt class="event-label event-label-start"><?php _e('Starts:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-start"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d' ); ?>"/><?php echo tribe_get_start_date( null, false, 'F j, Y' ); ?></dd>
<dt class="event-label event-label-from"><?php _e('From:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-from"><meta itemprop="fromTime" content="<?php echo tribe_get_start_date( null, false, 'g:ia' ); ?>"/><?php echo tribe_get_start_date( null, false, 'g:ia' ); ?> to <?php echo tribe_get_end_date( null, false, 'g:ia'); ?></dd>
<?php } else { ?>
<dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-date"><meta itemprop="startDate" content="<?php echo tribe_get_start_date( null, false, 'Y-m-d' ); ?>"/><?php echo tribe_get_start_date(); ?></d
@ihorduchenko
ihorduchenko / kia_add_script_to_footer.php
Created November 9, 2017 08:27 — forked from helgatheviking/kia_add_script_to_footer.php
Add plus and minus buttons to WooCommerce quantity inputs
@ihorduchenko
ihorduchenko / jquery-active.js
Created April 1, 2017 13:27 — forked from agragregra/jquery-active.js
jQuery Active Menu
//Active menu
$("li a").each(function() {
if (this.href == window.location.href) {
$(this).addClass("active");
}
});
@ihorduchenko
ihorduchenko / functions.php
Created April 1, 2017 13:21 — forked from agragregra/functions.php
WordPress functions.php Must Have
show_admin_bar(false);
add_theme_support('post-thumbnails');
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');