This file contains 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 | |
/** | |
* Loop Add to Cart -- with quantity and AJAX | |
* requires associated JavaScript file qty-add-to-cart.js | |
* | |
* @link http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/ | |
* @link https://gist.github.com/mikejolley/2793710/ | |
*/ | |
// add this file to folder "woocommerce/loop" inside theme |
This file contains 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
/** | |
* Check for Astra Advanced Headers and add header ID class to body classes for per-header styling | |
* @author Tristan Mason <tristanmason.com> | |
*/ | |
function tmac_add_advanced_header_class( $classes ) { | |
// only run if Advanced Headers exists and is enabled on this page | |
if ( (int)method_exists('Astra_Ext_Advanced_Headers_Data', 'get_current_page_header_ids') && in_array('ast-advanced-headers',$classes) ) { | |
$tmac_header_ids = Astra_Ext_Advanced_Headers_Data::get_current_page_header_ids(); | |
$classes[] = 'tmac-header-id-' . $tmac_header_ids; | |
} |