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
//The idea is that we're modifying the query such that it will only show top-level items.... thus (in theory) nothing that has been assigned to a group, which would then have the group product's ID as the post_parent. | |
add_action( 'woocommerce_product_query', 'musamam_product_query' ); | |
function musamam_product_query( $q ){ | |
$q->set( 'post_parent', 0 ); | |
} |
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 option price in WooCommerce product | |
* WooCommerce Dynamic Pricing with Product Add-ons on Checkout | |
* https://www.youtube.com/watch?v=syd2OlKdeVc | |
*/ | |
add_action( 'woocommerce_before_calculate_totals', 'divi_add_option_price' ); | |
function divi_add_option_price( $cart_object ){ | |
foreach ( $cart_object->cart_contents as $key => $value ) { | |
//$product_id = $value['product_id']; |
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
# Install: | |
npm install -g http-server. | |
# After installation cd into your project folder and run http-server -o. -o is to open browser to the page. | |
http-server -o |
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 | |
/** | |
* This code shows pagination for WooCommerce shortcodes when it's embeded on single pages. | |
* Include into functions.php. | |
*/ | |
if ( ! is_admin() ) { | |
// ---------------------- FRONTPAGE ------------------- | |
if ( defined('WC_VERSION') ) { |
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> | |
/** | |
* Add Class to header area to make it sticky. | |
* Placed into header or footer area. | |
*/ | |
function init() { | |
window.addEventListener('scroll', function(e){ | |
var distanceY = window.pageYOffset || document.documentElement.scrollTop, | |
shrinkOn = 300, | |
header = document.getElementById("headerID"); //Header ID |
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 | |
/** | |
* == About this Gist == | |
* | |
* Code to add to wp-config.php to enhance information available for debugging. | |
* | |
* You would typically add this code below the database, language and salt settings | |
* | |
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists). | |
* |
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 | |
/** | |
* The template for displaying featured posts on the front page | |
* | |
* @package WordPress | |
* @subpackage Twenty_Fourteen | |
* @since Twenty Fourteen 1.0 | |
*/ | |
?> |
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
# Make directory | |
$ mkdir vagrant_test | |
# Init Vagrant | |
$ vagrant init | |
# Add boxes to Vagrant | |
$ vagrant box add ubuntu/trusty64 ##https://atlas.hashicorp.com/boxes/search | |
# Open Vagrant File in editor and add/update |
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
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ } | |
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ } | |
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ } | |
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ } | |
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ } | |
@media (min-width:1281px) { /* hi-res laptops and desktops */ } |