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
add_filter('astra_woo_shop_product_categories' , 'category_callback'); | |
function category_callback(){ | |
$product_categories = function_exists( 'wc_get_product_category_list' ) ? wc_get_product_category_list( get_the_ID(), ',', '', '' ) : $product->get_categories( ',', '', '' ); | |
$categories = !empty( $product_categories ) ? $product_categories : '' ; | |
return $categories; | |
} |
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
add_action('astra_entry_after', 'callback_function'); | |
function callback_function(){ | |
$enable_meta = apply_filters( 'astra_blog_post_meta_enabled', '__return_true' ); | |
$post_meta = astra_get_option( 'blog-meta' ); | |
if ( is_array( $post_meta ) && $enable_meta ) { | |
$output_str = astra_get_post_meta( $post_meta ); | |
if ( ! empty( $output_str ) ) { | |
echo apply_filters( 'astra_blog_post_meta', '<div class="entry-meta">' . $output_str . '</div>', $output_str ); | |
} | |
} |
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
// Footer Widget 1 | |
add_filter( 'astra_advanced_footer_widget_1_args', 'widget_title_footer_1_tag', 10, 1 ); | |
function widget_title_footer_1_tag( $atts ) { | |
$atts['before_title'] = '<h1 class="widget-title">'; | |
$atts['after_title'] = '</h1>'; | |
return $atts; | |
} | |
// Footer Widget 2 | |
add_filter( 'astra_advanced_footer_widget_2_args', 'widget_title_footer_2_tag', 10, 1 ); | |
function widget_title_footer_2_tag( $atts ) { |
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
add_filter( 'astra_enable_default_fonts', 'temp_disable_astra_fonts' ); | |
function temp_disable_astra_fonts( $load ) { | |
$load = false; | |
return $load; | |
} | |
add_action( 'wp_head', 'add_astra_fonts_preload', 1 ); | |
function add_astra_fonts_preload() { | |
?> | |
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/themes/astra/assets/fonts/astra.woff" as="font" crossorigin /> | |
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/themes/astra/assets/fonts/astra.ttf" as="font" crossorigin /> |
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 category above the title in Astra Theme | |
* | |
* @todo Change the `prefix_` and with your own unique prefix. | |
* | |
* @since 1.0.0 | |
*/ | |
if( ! function_exists( 'prefix_function_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 | |
add_filter( 'the_category_list', function( $categories ) { | |
if( ! empty( $categories ) && is_array($categories) ) { | |
foreach ($categories as $key => $cat) { | |
if( ! $cat->parent ) { | |
$ob[] = $categories[$key]; | |
return $ob; | |
} | |
} | |
} |