This file contains hidden or 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
<?php | |
class drivdigital_activation_page { | |
static function demo_front_page() { | |
/** | |
* Installing a page for us to set as the home page | |
*/ | |
if ( isset( $_GET['activated'] ) && is_admin() ) { | |
$content = wp_remote_get( 'http://drivdigital.github.io/driv-starter/' ); |
This file contains hidden or 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
<?php | |
/* What thumbnail sizes are there?*/ | |
echo '<pre>'; | |
print_r( get_intermediate_image_sizes() ); | |
echo '</pre>'; | |
?> |
This file contains hidden or 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
var elem = document.querySelector( 'body' ); // Pick your element | |
var value = '0 1px 0 red'; // Change the CSS here | |
elem.style.textShadow = value; // Apply this value to textShadow | |
// All CSS in javascript is stripped of hyphens | |
// and has uppercase letters for all words | |
// after the first one. IE: text-shadow = textShadow |
This file contains hidden or 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
img { | |
/* Same as first example */ | |
min-height: 50px; | |
&:before { | |
content: " "; | |
display: block; | |
position: absolute; | |
top: -10px; | |
left: 0; | |
height: calc(100% + 10px); |
This file contains hidden or 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
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |
This file contains hidden or 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" defer="defer"> | |
( function( $ ) { | |
acf.add_action('load', function( $el ){ | |
$( 'div.values > [data-layout="product_category"]' ).each( function(){ | |
var $name = $( '[data-name="menu_item_name"] input[type="text"]', $( this ) ); | |
var $fallback = $( '.select2-chosen', $( this ) ); | |
$name = $name.clone().val(); | |
$fallback = $fallback.clone().text(); | |
$name = $name + ' / ' + $fallback; | |
var $title = $( '.acf-fc-layout-handle', $( this ) ); |
This file contains hidden or 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
<?php | |
/** | |
* Theme options for custom mega menu | |
*/ | |
if( function_exists('acf_add_options_page') ) { | |
$theme_option = 'theme-options'; | |
acf_add_options_page(array( | |
'page_title' => 'Theme Settings', |
This file contains hidden or 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
"use strict"; | |
$(function(){ | |
var getTextNodesIn = function(el) { | |
return $(el).find(":not(iframe)").addBack().contents().filter(function() { | |
return this.nodeType == 3; | |
}); | |
}; |
This file contains hidden or 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
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains hidden or 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
<?php | |
/* | |
Woocommerce cart that shows upto 3 | |
*/ | |
$visible_item_count = 0; | |
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { | |
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); | |
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); | |
if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) { ?> |