You can use the hooks below if you need to have a different layout for a category than the general layout. Through these hooks, you can change both the Content Block that generates the Header layout and the Content Block that generates the Content layout. In a nutshell, through these hooks, it is possible to overwrite, when creating a custom layout, the Content Blocks related to Header and Content parts, screenshot ;
WooCommerce Header
/********************** * * Filter the Content Block for Headers on WooCommerce index pages * @param string $val Original Content Block ID * @return string * **********************/ add_filter( 'uncode_ot_get_option_uncode_product_index_blocks', 'uncode_child_header_products_cb' ); function uncode_child_header_products_cb( $val ) { // Any conditional tag allowed if( is_tax( 'product_cat', 'clothes' ) ) { $val = 1133; //the Content Block ID you want to use instead of the default one } return $val; }
WooCommerce Content
/********************** * * Filter the Content Block for the Content on WooCommerce index pages * @param string $val Original Content Block ID * @return string * **********************/ add_filter( 'uncode_ot_get_option_uncode_product_index_content_block', 'uncode_child_content_products_cb' ); function uncode_child_content_products_cb( $val ) { // Any conditional tag allowed if( is_tax( 'product_cat', 'clothes' ) ) { $val = 1135; //the Content Block ID you want to use instead of the default one } return $val; }
Portfolio Header
/********************** * * Filter the Content Block for Headers on Portfolio index pages * @param string $val Original Content Block ID * @return string * **********************/ add_filter( 'uncode_ot_get_option_uncode_portfolio_index_blocks', 'uncode_child_header_portfolio_cb' ); function uncode_child_header_portfolio_cb( $val ) { // Any conditional tag allowed if( is_tax( 'portfolio_category', 'marketing' ) ) { $val = 1144; //the Content Block ID you want to use instead of the default one } return $val; }
Portfolio Content
/********************** * * Filter the Content Block for the Content on Portfolio index pages * @param string $val Original Content Block ID * @return string * **********************/ add_filter( 'uncode_ot_get_option_uncode_portfolio_index_content_block', 'uncode_child_content_portfolio_cb' ); function uncode_child_content_portfolio_cb( $val ) { // Any conditional tag allowed if( is_tax( 'portfolio_category', 'marketing' ) ) { $val = 1145; //the Content Block ID you want to use instead of the default one } return $val; }
Blog Header
/********************** * * Filter the Content Block for Headers on Blog index pages * @param string $val Original Content Block ID * @return string * **********************/ add_filter( 'uncode_ot_get_option_uncode_post_index_blocks', 'uncode_child_header_post_cb' ); function uncode_child_header_post_cb( $val ) { // Any conditional tag allowed if( is_category( 'news' ) ) { $val = 1155; //the Content Block ID you want to use instead of the default one } return $val; }
Blog Content
/********************** * * Filter the Content Block for the Content on Blog index pages * @param string $val Original Content Block ID * @return string * **********************/ add_filter( 'uncode_ot_get_option_uncode_post_index_content_block', 'uncode_child_content_post_cb' ); function uncode_child_content_post_cb( $val ) { // Any conditional tag allowed if( is_category( 'news' ) ) { $val = 1156; //the Content Block ID you want to use instead of the default one } return $val; }
Comments
0 comments
Article is closed for comments.