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
// Remove the default comments from Astra. | |
add_action( | |
'init', | |
function() { | |
if ( class_exists( 'Astra_Loop' ) ) { | |
remove_action( 'astra_template_parts_content', array( Astra_Loop::get_instance(), 'template_parts_comments' ), 15 ); | |
} | |
}, | |
11 | |
); |
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 jk_add_custom_sku() { | |
$args = array( | |
'label' => __( 'Custom SKU', 'woocommerce' ), | |
'placeholder' => __( 'Enter custom SKU here', 'woocommerce' ), | |
'id' => 'jk_sku', | |
'desc_tip' => true, | |
'description' => __( 'This SKU is for internal use only.', 'woocommerce' ), | |
); |
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 | |
/** | |
* Email Order Items | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-items.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
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 prefix_add_selectbox() { | |
$args = array( | |
'id' => 'my_new_select', // required. The meta_key ID for the stored value | |
'wrapper_class' => '', // a custom wrapper class if needed | |
'desc_tip' => true, // makes your description show up with a "?" symbol and as a tooltip | |
'description' => __('My awesome select box', 'your_text_domain'), | |
'label' => __( 'My New Select', 'your_text_domain' ), | |
'options' => array( | |
'value1' => __( 'Text 1', 'your_text_domain' ), |
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 prefix_add_checkbox() { | |
$args = array( | |
'label' => '', // Text in the editor label | |
'class' => '', | |
'style' => '', | |
'wrapper_class' => '', // custom CSS class for styling | |
'value' => '', // meta_value where the id serves as meta_key | |
'id' => '', // required, it's the meta_key for storing the value (is checked or not) | |
'name' => '', |
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 prefix_add_textarea() { | |
$args = array( | |
'label' => '', // Text in the label in the editor view | |
'placeholder' => '', // Give advice or examples as placeholder | |
'class' => '', | |
'style' => '', | |
'wrapper_class' => '', | |
'value' => '', // if empty, will be loaded as meta_value for the meta_key with the given 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 | |
function prefix_add_text_input() { | |
$args = array( | |
'label' => '', // Text in the label in the editor. | |
'placeholder' => '', // Give examples or suggestions as placeholder | |
'class' => '', | |
'style' => '', | |
'wrapper_class' => '', | |
'value' => '', // if empty, retrieved from post_meta | |
'id' => '', // required, will be used as meta_key |
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
.gf_progressbar { | |
margin-left: -40px; | |
} | |
.gf_progressbar .gf_progressbar_percentage > span { | |
position: absolute; | |
left: -40px; | |
top: -2px; | |
} |
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
/** | |
* This code snippet removes JavaScript and CSS files loaded from WooCommerce if they are not necessary. | |
* | |
* Please test this on a staging copy of your website before putting this into the functions.php of your live website. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'my_remove_woo_assets', 99 ); | |
function my_remove_woo_assets() { | |
if ( function_exists( 'is_woocommerce' ) ) { // Check if Woo is installed. | |
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { // Only run on non-Woo pages. | |
// Remove unnecessary stylesheets. |
NewerOlder