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 | |
/* | |
* Automatically adding the product to the cart. | |
*/ | |
function aaptc_add_product_to_cart( $item_key, $product_id ) { | |
$product_category_id = 123; // cricket bat category id |
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 | |
/* | |
* Automatically adding the product to the cart. | |
*/ | |
function aaptc_add_product_to_cart() { | |
if ( ! is_admin() ) { | |
$product_id = 12986; // Product Id of the free product which will get added to cart | |
$found = false; |
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 | |
// don't use | |
/** ====================================================================================== | |
* | |
* Read More the_content_more_link | |
* Check for the default <!--more--> and change it | |
* but leave custom <!--more Custom Text--> alone | |
* | |
======================================================================================= */ |
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 | |
/** ==================================================================================== | |
* Return single product template page based on category slug | |
==================================================================================== **/ | |
/** ========== Instructions ======================================================== |
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
#AND | |
<b:if cond='data:blog.pageType == "index"'> | |
<b:if cond='data:blog.searchQuery'> | |
<!--search_page AND index_page--> | |
</b:if> | |
</b:if> | |
#OR |
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
//* Wrap .nav-primary in a custom div | |
add_filter( 'genesis_do_nav', 'genesis_child_nav', 10, 3 ); | |
function genesis_child_nav($nav_output, $nav, $args) { | |
return '<div class="nav-primary-wrapper">' . $nav_output . '</div>'; | |
} | |
//* Wrap .nav-secondary in a custom div | |
add_filter( 'genesis_do_subnav', 'genesis_child_subnav', 10, 3 ); |