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
# 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
/** | |
* 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
//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_action('woocommerce_single_product_summary', 'my_after_woocommerce_single_product_summary', 21); | |
function my_after_woocommerce_single_product_summary() { | |
global $post, $product; | |
if (is_object_in_term($post->ID, 'product_cat', array('tshirts'))) { | |
echo 'Your Custom Pricing Table'; | |
} | |
} |
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
ini_set('log_errors','On'); | |
ini_set('display_errors','Off'); | |
ini_set('error_reporting', E_ALL ); | |
define('WP_DEBUG', false); | |
define('WP_DEBUG_LOG', true); | |
define('WP_DEBUG_DISPLAY', false); |
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 Shortcode | |
function nebco_bannerboxes() { | |
/* Turn on buffering */ | |
ob_start(); ?> | |
<div class="box first-box hvr-top hvr-underline-from-center"> | |
<hr class="vertical"> | |
<h4>THE NEBCO</h4><h4>STORY</h4> | |
<a href="#"> | |
<p class="et_pb_button butt custum-butt">READ MORE</p> |
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
/** | |
* Compiles SCSS files into CSS | |
* | |
* @src .scss files that do not start with _ | |
* @dest .css files | |
*/ | |
gulp.task('scss', function() { | |
return gulp.src(['scss/**/*.scss', '!scss/**/_*']) | |
.pipe(scss()) | |
.pipe(gulp.dest('css')); |
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
-------------------- | |
1- Images should have alt tags. | |
2- Links should have alt tag if using with images. | |
3- ARIA role should need to add for html section. | |
4- ARIA attributes need to add for html elements. ** https://www.sitepoint.com/how-to-use-aria-effectively-with-html5/ | |
Accessibility Plugins: | |
https://wordpress.org/plugins/access-monitor/ | |
https://wordpress.org/plugins/wa11y/ |
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
/** | |
* Function to Async an arrayed list of JavaScript files. | |
* | |
* @param $tag | |
* @param $handler | |
* @param $src | |
* | |
* @return mixed | |
*/ | |
function async_scripts( $tag, $handler, $src ) { |