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 | |
// This code should be added to the functions.php file of the child theme | |
// Add custom info to Additional Information product tab | |
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); | |
function woo_rename_tabs( $tabs ) { | |
global $product; | |
$tabs['additional_information']['callback'] = 'custom_function_name'; // this is the function name which is included below | |
return $tabs; | |
} |
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 | |
// add this code to the functions.php file of your Theme or Child Theme | |
/* | |
* Add Custom tabs to WooCommerce products which contain content stored in custom fields (product postmeta fields) | |
* This example is adding 3 tabs. Product Instructions, Size Chart, and Tech Specs | |
* There are 2 pieces that are needed: | |
* 1. Declare the tab | |
* 2. Declare the contents of the tab | |
* Recommended to use ACF (advanced custom fields plugin) to managage the tab content per product. |
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 | |
/* This code goes into your child theme's function.php file | |
* Or it can use FacetWP's recommendation and use a plugin https://facetwp.com/how-to-use-hooks/ | |
* | |
* I found that the tutorial on FacetWP's site didn't function how I wanted it to. | |
* https://facetwp.com/how-to-hide-the-template-until-facets-are-selected/ | |
* Their method doesn't allow a template to show if you use a link with a url query, indicating a facet selection, it only works if | |
* if you 'click' on the page. So I came up with some JS that looks at the facet list, and looks for any 'checked' items. | |
* This way, whether it was clicked while on the page, or you linked to the page with a query string selection, it still works as I wanted. | |
*/ |
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 | |
/** | |
* Check if WooCommerce is active | |
**/ | |
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { | |
// remove product thumbnail and title from the shop loop | |
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); | |
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
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { | |
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); | |
add_action( 'woocommerce_before_shop_loop_item_title', 'sls_woocommerce_template_loop_product_thumbnail', 10 ); | |
function sls_woocommerce_template_loop_product_thumbnail() { | |
echo '<a class="thumbnail" title="'.get_the_title().'" href="'. get_the_permalink() . '">'.woocommerce_get_product_thumbnail().'</a>'; | |
echo '<h3><a href="'.get_the_permalink().'">'.get_the_title().'</a></h3>'; | |
} |
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
/* Put this in your preferred CSS location */ | |
/* Modal CSS */ | |
/* The Modal (background) */ | |
.sls-modal { | |
display: none; | |
position: fixed; | |
z-index: 999; | |
left: 0; | |
right: 0; | |
top: 0; |
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 | |
function fod_custom_customizer_options( $wp_customize ) { | |
$wp_customize->add_section( 'fod_options' , array( | |
'title' => __('Homepage Popup Form'), | |
'panel' => '', | |
'priority' => 1000 | |
) ); |
NewerOlder