__( 'Primary Menu', 'teilzeitladen' ), 'footer' => __( 'Footer Menu', 'teilzeitladen' ), ) ); // Image sizes add_image_size( 'product-card', 400, 400, true ); add_image_size( 'hero', 1920, 600, true ); } add_action( 'after_setup_theme', 'teilzeitladen_setup' ); /** * WooCommerce support */ function teilzeitladen_woocommerce_setup() { add_theme_support( 'woocommerce' ); add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } add_action( 'after_setup_theme', 'teilzeitladen_woocommerce_setup' ); /** * Custom excerpt length */ function teilzeitladen_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'teilzeitladen_excerpt_length', 999 ); /** * Notice Banner (Admin controlled) */ function teilzeitladen_notice_banner() { $notice_text = get_theme_mod( 'teilzeitladen_notice_text', '' ); $notice_link = get_theme_mod( 'teilzeitladen_notice_link', '' ); $notice_enabled = get_theme_mod( 'teilzeitladen_notice_enabled', false ); if ( $notice_enabled && ! empty( $notice_text ) ) : ?>
add_section( 'teilzeitladen_notice', array( 'title' => __( 'Notice Banner', 'teilzeitladen' ), 'priority' => 30, ) ); $wp_customize->add_setting( 'teilzeitladen_notice_enabled', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean', ) ); $wp_customize->add_control( 'teilzeitladen_notice_enabled', array( 'label' => __( 'Enable Notice Banner', 'teilzeitladen' ), 'section' => 'teilzeitladen_notice', 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'teilzeitladen_notice_text', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'teilzeitladen_notice_text', array( 'label' => __( 'Notice Text', 'teilzeitladen' ), 'section' => 'teilzeitladen_notice', 'type' => 'text', ) ); $wp_customize->add_setting( 'teilzeitladen_notice_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'teilzeitladen_notice_link', array( 'label' => __( 'Notice Link (optional)', 'teilzeitladen' ), 'section' => 'teilzeitladen_notice', 'type' => 'url', ) ); } add_action( 'customize_register', 'teilzeitladen_customize_register' ); /** * Disable admin bar for non-admins */ function teilzeitladen_disable_admin_bar() { if ( ! current_user_can( 'administrator' ) && ! is_admin() ) { show_admin_bar( false ); } } add_action( 'after_setup_theme', 'teilzeitladen_disable_admin_bar' );