Created
November 19, 2018 14:49
-
-
Save akther80/2c49ced535592f94462ad300227f2bd8 to your computer and use it in GitHub Desktop.
Electro v2 Remove jumbotron in search result
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
if( ! function_exists( 'electro_shop_archive_jumbotron' ) ) { | |
function electro_shop_archive_jumbotron() { | |
$static_block_id = ''; | |
$brands_taxonomy = electro_get_brands_taxonomy(); | |
if( is_shop() && !is_search() ) { | |
$static_block_id = apply_filters( 'electro_shop_jumbotron_id', '' ); | |
} else if ( is_product_category() || is_tax( $brands_taxonomy ) ) { | |
$term = get_queried_object(); | |
$term_id = $term->term_id; | |
$static_block_id = get_woocommerce_term_meta( $term_id, 'static_block_id', true ); | |
} | |
if( ! empty( $static_block_id ) ) { | |
if ( is_elementor_activated() ) { | |
$content = \Elementor\Plugin::$instance->frontend->get_builder_content_for_display( $static_block_id ); | |
} | |
if( empty( $content ) ) { | |
$static_block = get_post( $static_block_id ); | |
$content = do_shortcode( $static_block->post_content ); | |
} | |
echo $content; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment