Skip to content

Instantly share code, notes, and snippets.

View VanessaKing's full-sized avatar

Vanessa King VanessaKing

View GitHub Profile
// Adding Custom Redirection field in LD Courses
add_filter( 'learndash_post_args', 'add_topic_option' );
function add_topic_option( $post_args ) {
// New Course field to add redirection link.
$redirect_on_completion = array(
'redirect_on_completion' => array(
'name' => __( 'Redirect on Completion', 'learndash' ),
'type' => 'text',
'initial_options' => '',
@VanessaKing
VanessaKing / vc_custom_icon_set.php
Created April 24, 2020 05:29 — forked from zecka/vc_custom_icon_set.php
Add a custom icon set from icomoon to visual composer vc_icon shortcode
<?php
// Add new custom font to Font Family selection in icon box module
function zeckart_add_new_icon_set_to_iconbox( ) {
$param = WPBMap::getParam( 'vc_icon', 'type' );
$param['value'][__( 'IcoMoon', 'total' )] = 'icomoon';
vc_update_shortcode_param( 'vc_icon', $param );
}
add_filter( 'init', 'zeckart_add_new_icon_set_to_iconbox', 40 );
@VanessaKing
VanessaKing / gist:09b5d7994e57422fc7fd3b1a08c2eab4
Created January 18, 2020 03:44 — forked from fanfare/gist:d6539fa15ced86811313cb6fb1b0597e
EMERGENCY STYLESHEET TO MAKE GOOGLE RESULTS LOOK LESS MESSED UP
/* warning not yet stable.. messed up on video results pages.. need to fix.. */
div.g .r a {
pointer-events:none
}
div.g a h3 {
pointer-events:all!important
}
div.g h3 {
transform:translateY(-22px) translateX(-1px);
@VanessaKing
VanessaKing / gist:0cadf8313a8b8180d40cf0690a43b84b
Created March 25, 2019 04:44 — forked from pdewouters/gist:2693274
featured posts loop with wp_reset_postdata
/**
* Filter the home page posts, and remove any featured post ID's from it. Hooked
* onto the 'pre_get_posts' action, this changes the parameters of the query
* before it gets any posts.
*
* @global array $featured_post_id
* @param WP_Query $query
* @return WP_Query Possibly modified WP_query
* http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/
*/
@VanessaKing
VanessaKing / fontsmoothie.js
Created December 25, 2017 10:53 — forked from letorbi/fontsmoothie.js
This code enforces font-smothing for web fonts even if it's not enabled in the system settings. More info: http://pixelsvsbytes.com/blog/2013/02/nice-web-fonts-for-every-browser
// Font Smoothie copyright 2013,14,15 Torben Haase <http://pixelsvsbytes.com>
// Source-URL <https://gist.github.com/letorbi/5177771>
//
// Font Smoothie is free software: you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version.
//
// Font Smoothie is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
@VanessaKing
VanessaKing / collection.liquid
Created July 22, 2017 08:45 — forked from DanWebb/collection.liquid
Shopify filter code with working example
<!-- add the options +tags to the listed products attributes -->
{% if p.options[0] == 'Color' %}{% capture colours %}{% for variant in p.variants %}{% unless forloop.first %},{% endunless %}{{ variant.options[0] }}{% endfor %}{% endcapture %}{% endif %}
{% if p.options[1] == 'Material' %}{% capture materials %}{% for variant in p.variants %}{% unless forloop.first %},{% endunless %}{{ variant.options[1] }}{% endfor %}{% endcapture %}{% endif %}
{% if p.options[2] == 'Style' %}{% capture styles %}{% for variant in p.variants %}{% unless forloop.first %},{% endunless %}{{ variant.options[2] }}{% endfor %}{% endcapture %}{% endif %}
{% if p.tags %}{% capture tagg %}{% for tag in p.tags %}{% if tag contains 'recommended:' %}{% unless forloop.first %},{% endunless %}{{ tag | replace: 'recommended:', '' }}{% endif %}{% endfor %}{% endcapture %}{% endif %}
<div class="product" data-colours="{{ colours | escape }}" data-materials="{{ materials | escape }}" data-styles="{{ styles | escape }}" data-tags="{{ tagg | esc
@VanessaKing
VanessaKing / shopify-flexslider.liquid
Created August 30, 2016 23:46 — forked from bmodena/shopify-flexslider.liquid
Shopify Flexslider Integration with theme settings
<!-- add to head of your theme.liquid after moving the files into the assets folder | https://www.woothemes.com/flexslider/ -->
<!-- add only if you theme is not already including Jquery-->
{{ '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js' | script_tag }}
<!-- FLEX Slider css and .js -->
{{ 'flexslider.css' | asset_url | stylesheet_tag }}
{{ 'jquery.flexslider.js' | asset_url | script_tag }}
<!--
add to schema json
@VanessaKing
VanessaKing / functions.php
Created August 30, 2016 21:14 — forked from tharmann/functions.php
Add a more descriptive tooltip to the CVC field on the WooCommerce order form credit card fields
<?php
//add tooltip to cvc field
function custom_credit_card_fields_cis_cc ($cc_fields , $payment_id){
$cc_fields['card-cvc-field'] = str_replace('<p class="form-row form-row-last">','<p class="form-row form-row-last" title="3-digit security code usually found on the back of your card. American Express cards have a 4-digit code located on the front.">',$cc_fields['card-cvc-field']);
return $cc_fields;
}
add_filter( 'woocommerce_credit_card_form_fields' , 'custom_credit_card_fields_cis_cc' , 10, 2 );
@VanessaKing
VanessaKing / luhn.js
Created May 8, 2016 14:04 — forked from ShirtlessKirk/luhn.js
Luhn validation algorithm
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,
@VanessaKing
VanessaKing / custom-search-acf-wordpress.php
Last active September 22, 2015 08:26 — forked from charleslouis/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}