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('admin_enqueue_scripts' , 'custom_editor_styles'); | |
| function custom_editor_styles( ){ | |
| echo ' | |
| <style> | |
| .mce-content-body p{ | |
| color:red; | |
| } | |
| </style> | |
| '; |
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( 'wp', 'remove_empty_cart_icon_from_header' ); | |
| function remove_empty_cart_icon_from_header( $show ) { | |
| if ( null != WC()->cart && 0 == WC()->cart->get_cart_contents_count() ) { | |
| remove_action( 'astra_header_woo_cart', array( Astra_Builder_Header::get_instance(), 'header_woo_cart' ) ); | |
| } | |
| } |
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 your_prefix_post_date( $output ) { | |
| $format = apply_filters( 'astra_post_date_format', '' ); | |
| $modified_date = esc_html( get_the_modified_date( $format ) ); | |
| $modified_on = sprintf( | |
| esc_html( '%s' ), | |
| $modified_date | |
| ); |
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( 'wp', 'astra_modify_search_loop', 99 ); | |
| /** | |
| * Modify Search Loop. | |
| * | |
| * @return void | |
| */ | |
| function astra_modify_search_loop() { | |
| remove_action( 'astra_content_loop', array( Astra_Loop::get_instance(), 'loop_markup' ) ); | |
| add_action( 'astra_content_loop', 'astra_redo_loop_markup' ); |
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( 'wp', 'astra_modify_search_loop', 99 ); | |
| /** | |
| * Modify Search Loop. | |
| * | |
| * @return void | |
| */ | |
| function astra_modify_search_loop() { | |
| remove_action( 'astra_content_loop', array( Astra_Loop::get_instance(), 'loop_markup' ) ); | |
| add_action( 'astra_content_loop', 'astra_redo_loop_markup' ); |
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_after_single_product','add_back_product_category_button', 5); | |
| function add_back_product_category_button(){ | |
| // Get the product categories set in the product | |
| $terms = wp_get_post_terms( get_the_id(), 'product_cat' ); | |
| // Check that there is at leat one product category set for the product | |
| if(sizeof($terms) > 0){ | |
| // Get the first product category WP_Term object | |
| $term = reset($terms); |
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( 'wp_head', 'add_astra_fonts_preload', 1 ); | |
| function add_astra_fonts_preload() { | |
| $font_list = apply_filters( 'astra_render_fonts', Astra_Fonts::get_fonts() ); | |
| $google_fonts = array(); | |
| $font_subset = array(); | |
| $system_fonts = Astra_Font_Families::get_system_fonts(); | |
| foreach ( $font_list as $name => $font ) { | |
| if ( ! empty( $name ) && ! isset( $system_fonts[ $name ] ) ) { | |
| // Add font variants. | |
| $google_fonts[ $name ] = $font['variants']; |
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( 'astra_woo_single_title_after', 'custom_sub_title', 10 ); | |
| function custom_sub_title() { | |
| $data = get_post_meta( get_the_ID() , 'wc_ps_subtitle', true ); | |
| if( $data ){ | |
| ?> | |
| <p class="custom-product-subtitle"> | |
| <?php echo $data ?> | |
| </p> | |
| <?php | |
| } |
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
| remove_action( 'woocommerce_shop_loop_subcategory_title', 'woocommerce_template_loop_category_title', 10 ); | |
| add_action( 'woocommerce_shop_loop_subcategory_title', 'custom_category_title', 10 ); | |
| function custom_category_title( $category ) { | |
| ?>; | |
| <h2 class="woocommerce-loop-category__title"> | |
| <?php | |
| if ( $category->count > 0 ) { | |
| echo ' <mark class="count">(' . esc_html( $category->count ) . ')</mark>'; // WPCS: XSS ok. | |
| } | |
| ?> |
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_filter('astra_woo_shop_product_categories' , 'fnc_category'); | |
| function fnc_category($args = array()){ | |
| $woocommerce_category_id = get_queried_object_id(); | |
| $args = array( | |
| 'parent' => $woocommerce_category_id | |
| ); | |
| $terms = get_terms( 'product_cat', $args ); | |
| $categories = array(); | |
| if ( $terms ) { |
NewerOlder