get( 'Version' ) ); } add_action( 'wp_enqueue_scripts', 'altr_child_enqueue_styles' ); /** * Set the content width based on enabled sidebar */ function entr_main_content_width_columns() { $columns = '12'; $hide_sidebar = get_post_meta( get_the_ID(), 'envo_extra_hide_sidebar', true ); if ( is_active_sidebar( 'entr-right-sidebar' ) && is_singular() && $hide_sidebar == 'on' ) { $columns = '12'; } elseif ( is_active_sidebar( 'entr-right-sidebar' ) ) { $columns = $columns - 4; } echo absint( $columns ); } add_action( 'after_setup_theme', 'altr_setup' ); function altr_setup() { // Remove parent theme header fields remove_action( 'entr_header', 'entr_title_logo', 10 ); remove_action( 'entr_header', 'entr_menu', 20 ); remove_action( 'entr_header', 'entr_head_start', 25 ); remove_action( 'entr_header', 'entr_head_end', 80 ); // Create child theme header add_action( 'altr_header', 'entr_head_start', 25 ); add_action( 'altr_header', 'entr_head_end', 80 ); add_action( 'altr_header', 'altr_heder_widget', 20 ); add_action( 'altr_header', 'altr_title_logo', 10 ); add_action( 'entr_header', 'altr_menu', 20 ); add_action( 'altr_header', 'altr_heder_widget', 20 ); if ( class_exists( 'WooCommerce' ) ) { // re-position WooCommerce icons remove_action( 'entr_header', 'entr_header_cart', 30 ); remove_action( 'entr_header', 'entr_my_account', 40 ); remove_action( 'entr_header', 'entr_head_wishlist', 50 ); remove_action( 'entr_header', 'entr_head_compare', 60 ); add_action( 'altr_header', 'entr_header_cart', 30 ); add_action( 'altr_header', 'entr_my_account', 40 ); add_action( 'altr_header', 'entr_head_wishlist', 50 ); add_action( 'altr_header', 'entr_head_compare', 60 ); // add WooCommerce search field add_action( 'entr_header', 'altr_menu_search_widget', 20 ); } } /** * Title, logo code */ function altr_title_logo() { ?>
esc_html__( 'Header Section', 'altr' ), 'id' => 'altr-header-area', 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => esc_html__( 'Top bar', 'altr' ), 'id' => 'altr-top-bar', 'before_widget' => '', 'before_title' => '', ), ); } if (!function_exists('altr_top_bar')) : /** * Create top bar widget area */ add_action('altr_top_bar', 'altr_top_bar'); function altr_top_bar() { if (is_active_sidebar('altr-top-bar')) { ?>