get( 'Version' ); wp_enqueue_script( 'athlonx-options', get_template_directory_uri() . '/assets/js/options.min.js', array( 'jquery', 'customize-preview' ), $theme_version, true ); } ); /** * Register and add Customizer Theme Options panel. */ add_action( 'customize_register', function( $wp_customize ) { call_user_func_array( array( $wp_customize, 'add_panel' ), array( 'athlonx_theme_options', array( 'priority' => 180, 'capability' => 'edit_theme_options', 'title' => __( 'Theme Options', 'athlonx' ), 'desc' => __( 'AthlonX theme options panel.', 'athlonx' ), 'panel' => '', 'description_hidden' => true, ) ) ); $theme_options_panel_attrs['front_cta'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'CTA', 'athlonx' ), 'desc' => __( 'AthlonX theme call to action options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['front_extra'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Extra', 'athlonx' ), 'desc' => __( 'AthlonX theme front extra options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['front_product'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Featured Product', 'athlonx' ), 'desc' => __( 'AthlonX theme front featured product options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['front_footer'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Footer', 'athlonx' ), 'desc' => __( 'AthlonX theme front footer options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['general'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'General', 'athlonx' ), 'desc' => __( 'AthlonX theme General options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['front_header'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Header', 'athlonx' ), 'desc' => __( 'AthlonX theme front header options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['front_mosaic'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Mosaic', 'athlonx' ), 'desc' => __( 'AthlonX theme front mosaic options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['front_presentation'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Presentation', 'athlonx' ), 'desc' => __( 'AthlonX theme front presentation options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['front_product_variations'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Product Variations', 'athlonx' ), 'desc' => __( 'AthlonX theme front (2) products with vatiations options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); $theme_options_panel_attrs['front_slideshow'] = array( 'priority' => 10, 'capability' => 'edit_theme_options', 'title' => __( 'Sldieshow', 'athlonx' ), 'desc' => __( 'AthlonX theme front slideshow options panel.', 'athlonx' ), 'panel' => 'athlonx_theme_options', 'description_hidden' => true, ); foreach ( $theme_options_panel_attrs as $uuid => $attrs ) { call_user_func_array( array( $wp_customize, 'add_section' ), array( 'athlonx_theme_' . $uuid . '_options', $attrs ) ); } }, 10, 1 ); /** * Register and add Customizer Theme Options (and other) secondary modification variables. */ add_action( 'customize_register', function( $wp_customize ) { /** * 1. THEME OPTIONS > CTA */ // Text before. $wp_customize_control['athlonx_front_cta_text_before'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_cta_text_before', array( 'section' => 'athlonx_theme_front_cta_options', 'label' => 'Call to Action', 'description' => 'Add text and button content to your CTA area.
Text Before Heading', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_cta_text_before', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Heading text. $wp_customize_control['athlonx_front_cta_heading'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_cta_heading', array( 'section' => 'athlonx_theme_front_cta_options', 'label' => '', 'description' => 'Heading Text', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_cta_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Text after. $wp_customize_control['athlonx_front_cta_text_after'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_cta_text_after', array( 'section' => 'athlonx_theme_front_cta_options', 'label' => '', 'description' => 'Text After Heading', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_cta_text_after', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Button text. $wp_customize_control['athlonx_front_cta_button_text'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_cta_button_text', array( 'section' => 'athlonx_theme_front_cta_options', 'label' => '', 'description' => 'Button Text', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_cta_button_text', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Button link. $wp_customize_control['athlonx_front_cta_button_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_cta_button_link', array( 'section' => 'athlonx_theme_front_cta_options', 'label' => '', 'description' => 'Button Link', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_cta_button_link', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); /** * 2. THEME OPTIONS > EXTRA */ // Video placeholder image. $wp_customize_control['athlonx_front_video_placeholder_image'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_video_placeholder_image', array( 'section' => 'athlonx_theme_front_extra_options', 'label' => 'Video', 'description' => 'Select a static image and link for your video area.
Static Video Image', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 900, 'height' => 450, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_video_placeholder_image', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Video link. $wp_customize_control['athlonx_front_video_link_id'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_video_link_id', array( 'section' => 'athlonx_theme_front_extra_options', 'label' => '', 'description' => 'YouTube Video ID (e.g. pVE92TNDwUk)', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_video_link_id', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Content cover background. $wp_customize_control['athlonx_front_content_cover_background'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_content_cover_background', array( 'section' => 'athlonx_theme_front_extra_options', 'label' => 'Content Cover', 'description' => 'Select a background and add text for your conten cover area.
Background Image', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 1800, 'height' => 600, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_content_cover_background', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Content cover HTML. $wp_customize_control['athlonx_front_content_cover_html'] = new \WP_Customize_Code_Editor_Control( $wp_customize, 'athlonx_front_content_cover_html', array( 'section' => 'athlonx_theme_front_extra_options', 'label' => '', 'description' => 'Content Text (HTML)', 'type' => 'code_editor', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_content_cover_html', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); /** * 3. THEME OPTIONS > FEATURED PRODUCTS */ // Featured product name. $wp_customize_control['athlonx_front_featured_product_name'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_featured_product_name', array( 'section' => 'athlonx_theme_front_product_options', 'label' => '', 'description' => 'Text Above Image', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_featured_product_name', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Featured product image. $wp_customize_control['athlonx_front_featured_product_image'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_featured_product_image', array( 'section' => 'athlonx_theme_front_product_options', 'label' => 'Featured Product', 'description' => 'Select an image and link for your featured product area.
Foreground Image', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 1200, 'height' => 600, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_featured_product_image', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); /** * 4. THEME OPTIONS > FOOTER */ // Footer image $wp_customize_control['athlonx_front_footer_image'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_footer_image', array( 'section' => 'athlonx_theme_front_footer_options', 'label' => 'Footer Image', 'description' => 'Select an image for your footer area.', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 1200, 'height' => 600, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_footer_image', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Social networking links $wp_customize_control['athlonx_front_social_facebook_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_social_facebook_link', array( 'section' => 'athlonx_theme_front_footer_options', 'label' => 'Social Networking Links', 'description' => 'Add links to your social networking profiles.
Facebook', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_social_facebook_link', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Facebook. $wp_customize_control['athlonx_front_social_twitter_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_social_twitter_link', array( 'section' => 'athlonx_theme_front_footer_options', 'label' => '', 'description' => 'Twitter', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_social_twitter_link', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Twitter. $wp_customize_control['athlonx_front_social_instagram_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_social_instagram_link', array( 'section' => 'athlonx_theme_front_footer_options', 'label' => '', 'description' => 'Instagram', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_social_instagram_link', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Instagram. $wp_customize_control['athlonx_front_social_youtube_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_social_youtube_link', array( 'section' => 'athlonx_theme_front_footer_options', 'label' => '', 'description' => 'YouTube', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_social_youtube_link', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Youtube. /** * 5. THEME OPTIONS > GENERAL */ // Color palette. $wp_customize_control['athlonx_color_palette'] = new \WP_Customize_Control( $wp_customize, 'athlonx_color_palette', array( 'section' => 'athlonx_theme_general_options', 'label' => 'Color Palette', 'description' => 'Select color palette.', 'type' => 'select', 'choices' => array( 'amber' => 'Amber', 'blue-grey' => 'Blue Grey (default)', 'emerald' => 'Emerald', 'indigo' => 'Indigo', 'teal' => 'Teal', ), 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_color_palette', array( 'default' => 'blue-grey', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_html', ) ) ) ); // Font family. $wp_customize_control['athlonx_font_family'] = new \WP_Customize_Control( $wp_customize, 'athlonx_font_family', array( 'section' => 'athlonx_theme_general_options', 'label' => 'Font Family', 'description' => 'Select primary font family.', 'type' => 'select', 'choices' => array( 'Inconsolata' => 'Inconsolata', 'Lato' => 'Lato', 'Montserrat' => 'Montserrat (default)', 'Merriweather' => 'Merriweather', 'PT Sans' => 'PT Sans', 'PT Serif' => 'PT Serif', 'Raleway' => 'Raleway', 'Roboto' => 'Roboto ', 'Roboto Condensed' => 'Roboto Condensed', 'Ubuntu' => 'Ubuntu', ), 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_font_family', array( 'default' => 'Montserrat', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_html', ) ) ) ); // Body container width. $wp_customize_control['athlonx_theme_options'] = new \WP_Customize_Control( $wp_customize, 'athlonx_container_width', array( 'section' => 'athlonx_theme_general_options', 'label' => 'Container Width', 'description' => 'Select body container width.', 'type' => 'select', 'choices' => array( '960' => '960px', '1024' => '1024px', '1200' => '1200px (default)', // '1440' => '1440px', // '1680' => '1680px', // '2000' => '2000px', ), 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_container_width', array( 'default' => '1200', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_html', ) ) ) ); // Blog sidebar. $wp_customize_control['athlonx_blog_sidebar'] = new \WP_Customize_Control( $wp_customize, 'athlonx_blog_sidebar', array( 'section' => 'athlonx_theme_general_options', 'label' => 'Blog Sidebar', 'description' => 'Select blog sidebar visibility.', 'type' => 'select', 'choices' => array( 'hide' => 'hide (default)', 'show' => 'show', ), 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_blog_sidebar', array( 'default' => 'hide', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_html', ) ) ) ); // Blog cover title. $wp_customize_control['athlonx_header_title'] = new \WP_Customize_Control( $wp_customize, 'athlonx_header_title', array( 'section' => 'athlonx_theme_general_options', 'label' => 'Blog Cover', 'description' => 'Add content for you blog index cover area.
Header Title', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_header_title', array( 'default' => get_bloginfo( 'name' ), 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Blog cover text. $wp_customize_control['athlonx_header_text'] = new \WP_Customize_Control( $wp_customize, 'athlonx_header_text', array( 'section' => 'athlonx_theme_general_options', 'label' => '', 'description' => 'Header Text', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_header_text', array( 'default' => get_bloginfo( 'description' ), 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Blog cover button text. $wp_customize_control['athlonx_header_button_text'] = new \WP_Customize_Control( $wp_customize, 'athlonx_header_button_text', array( 'section' => 'athlonx_theme_general_options', 'label' => '', 'description' => 'Button Text', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_header_button_text', array( 'default' => 'Read more...', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Blog cover button link. $wp_customize_control['athlonx_header_button_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_header_button_link', array( 'section' => 'athlonx_theme_general_options', 'label' => '', 'description' => 'Button Link', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_header_button_link', array( 'default' => esc_url( home_url() ), 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); /** * 6. THEME OPTIONS > HEADER */ // Header background image. $wp_customize_control['athlonx_front_header_background'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_header_background', array( 'section' => 'athlonx_theme_front_header_options', 'label' => 'Header', 'description' => 'Select images for your header fore- and background parallax area.
Background Image', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 1600, 'height' => 1000, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_header_background', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Header foreground image. $wp_customize_control['athlonx_front_header_foreground'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_header_foreground', array( 'section' => 'athlonx_theme_front_header_options', 'label' => '', 'description' => 'Foreground Image (transparent)', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 1600, 'height' => 1000, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_header_foreground', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Header SVG logo. $wp_customize_control['athlonx_front_header_svg_logo'] = new \WP_Customize_Code_Editor_Control( $wp_customize, 'athlonx_front_header_svg_logo', array( 'section' => 'athlonx_theme_front_header_options', 'label' => 'Logo (SVG)', 'description' => 'Create SVG logo with the Font to SVG tool and add the generated code below.', 'type' => 'code_editor', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_header_svg_logo', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); /** * 7. THEME OPTIONS > MOSAIC */ // Mosaic block #1. $wp_customize_control['athlonx_front_mosaic_block_image_1'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_mosaic_block_image_1', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => 'Mosaic Block #1', 'description' => 'Add image and text for the mosaic block.', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 640, 'height' => 640, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_image_1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); $wp_customize_control['athlonx_front_mosaic_block_text_1'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_mosaic_block_text_1', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => '', 'description' => 'Text Overlay', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_text_1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Mosaic block #2. $wp_customize_control['athlonx_front_mosaic_block_image_2'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_mosaic_block_image_2', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => 'Mosaic Block #2', 'description' => 'Add image and text for the mosaic block.', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 640, 'height' => 640, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_image_2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); $wp_customize_control['athlonx_front_mosaic_block_text_2'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_mosaic_block_text_2', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => '', 'description' => 'Text Overlay', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_text_2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Mosaic block #3. $wp_customize_control['athlonx_front_mosaic_block_image_3'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_mosaic_block_image_3', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => 'Mosaic Block #3', 'description' => 'Add image and text for the mosaic block.
Image', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 640, 'height' => 640, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_image_3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); $wp_customize_control['athlonx_front_mosaic_block_text_3'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_mosaic_block_text_3', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => '', 'description' => 'Text Overlay', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_text_3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Mosaic block #4. $wp_customize_control['athlonx_front_mosaic_block_image_4'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_mosaic_block_image_4', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => 'Mosaic Block #4', 'description' => 'Add image and text for the mosaic block.', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 960, 'height' => 450, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_image_4', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); $wp_customize_control['athlonx_front_mosaic_block_text_4'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_mosaic_block_text_4', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => '', 'description' => 'Text Overlay', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_text_4', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Mosaic block #5. $wp_customize_control['athlonx_front_mosaic_block_image_5'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_mosaic_block_image_5', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => 'Mosaic Block #5', 'description' => 'Add image and text for the mosaic block.', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 320, 'height' => 320, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_image_5', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); $wp_customize_control['athlonx_front_mosaic_block_text_5'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_mosaic_block_text_5', array( 'section' => 'athlonx_theme_front_mosaic_options', 'label' => '', 'description' => 'Text Overlay', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_mosaic_block_text_5 ', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); /** * 8. THEME OPTIONS > PRESENTATION */ // Presentation heading. $wp_customize_control['athlonx_front_present_heading'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_present_heading', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => 'Presentation Content', 'description' => 'Add content for your presentation area.
Heading Text', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Presentation text. $wp_customize_control['athlonx_front_present_text'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_present_text', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => '', 'description' => 'Content Text', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_text', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Presentation step #1. $wp_customize_control['athlonx_front_present_step_1'] = new \WP_Customize_Code_Editor_Control( $wp_customize, 'athlonx_front_present_step_1', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => 'Presentation steps', 'description' => 'Add short text and describe your app with up to 4 steps.
Step #1', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_step_1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Presentation step #2. $wp_customize_control['athlonx_front_present_step_2'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_present_step_2', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => '', 'description' => 'Step #2', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_step_2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Presentation step #3. $wp_customize_control['athlonx_front_present_step_3'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_present_step_3', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => '', 'description' => 'Step #3', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_step_3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Presentation step #4. $wp_customize_control['athlonx_front_present_step_4'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_present_step_4', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => '', 'description' => 'Step #4', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_step_4', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // App store link. $wp_customize_control['athlonx_front_present_app_store_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_present_app_store_link', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => 'External Links', 'description' => 'Add external links for your app on App Store and Google Play.
App Store', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_app_store_link', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Google play link. $wp_customize_control['athlonx_front_present_google_play_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_present_google_play_link', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => '', 'description' => 'Google Play', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_google_play_link', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Screenshot. $wp_customize_control['athlonx_front_present_screenshot_image'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_present_screenshot_image', array( 'section' => 'athlonx_theme_front_presentation_options', 'label' => 'Screenshot', 'description' => 'Select an image to place inside the cellphone frame area.', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 1200, 'height' => 900, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_present_screenshot_image', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); /** * 9. THEME OPTIONS > PRODUCTS + VARIATIONS */ // Product heading. $wp_customize_control['athlonx_front_product_variation_heading'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_product_variation_heading', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => 'Prodcut Variations', 'description' => 'Add and link to product to your Shop with up to 6 variations.
Heading Text', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_heading', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Product price $wp_customize_control['athlonx_front_product_variation_price'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_product_variation_price', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => 'Price', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_price', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Action button text. $wp_customize_control['athlonx_front_product_variation_button_text'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_product_variation_button_text', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => 'Button Text', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_button_text', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Action button link. $wp_customize_control['athlonx_front_product_variation_button_link'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_product_variation_button_link', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => 'Button Link', 'type' => 'url', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_button_link', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Product colors. $wp_customize_control['athlonx_front_product_variation_colors'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_product_variation_colors', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => 'RGB Colors (separated with commas)', 'type' => 'text', 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_colors', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Product variation image #1. $wp_customize_control['athlonx_front_product_variation_image_1'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_product_variation_image_1', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => 'Product Images', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 600, 'height' => 300, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_image_1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Product variation image #2. $wp_customize_control['athlonx_front_product_variation_image_2'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_product_variation_image_2', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => '', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 600, 'height' => 300, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_image_2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Product variation image #3. $wp_customize_control['athlonx_front_product_variation_image_3'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_product_variation_image_3', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => '', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 600, 'height' => 300, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_image_3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Product variation image #4. $wp_customize_control['athlonx_front_product_variation_image_4'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_product_variation_image_4', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => '', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 600, 'height' => 300, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_image_4', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Product variation image #5. $wp_customize_control['athlonx_front_product_variation_image_5'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_product_variation_image_5', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => '', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 600, 'height' => 300, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_image_5', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Product variation image #6. $wp_customize_control['athlonx_front_product_variation_image_6'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_product_variation_image_6', array( 'section' => 'athlonx_theme_front_product_variations_options', 'label' => '', 'description' => '', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 600, 'height' => 300, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_product_variation_image_6', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); /** * 10. THEME OPTIONS > SLIDESHOW */ // Categories. $wp_customize_control['athlonx_front_slideshow_category'] = new \WP_Customize_Control( $wp_customize, 'athlonx_front_slideshow_category', array( 'section' => 'athlonx_theme_front_slideshow_options', 'label' => 'Content Category', 'description' => 'Select category which will be used to display content for slideshow area.', 'type' => 'select', 'choices' => get_post_categories(), 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_slideshow_category', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Slideshow image #1. $wp_customize_control['athlonx_front_slideshow_image_1'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_slideshow_image_1', array( 'section' => 'athlonx_theme_front_slideshow_options', 'label' => 'Slideshow Images', 'description' => 'Add up to 4 slideshow images to display content from the post category.', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 900, 'height' => 600, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_slideshow_image_1', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Slideshow image #2. $wp_customize_control['athlonx_front_slideshow_image_2'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_slideshow_image_2', array( 'section' => 'athlonx_theme_front_slideshow_options', 'label' => '', 'description' => '', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 900, 'height' => 600, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_slideshow_image_2', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Slideshow image #3. $wp_customize_control['athlonx_front_slideshow_image_3'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_slideshow_image_3', array( 'section' => 'athlonx_theme_front_slideshow_options', 'label' => '', 'description' => '', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 900, 'height' => 600, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_slideshow_image_3', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); // Slideshow image #4. $wp_customize_control['athlonx_front_slideshow_image_4'] = new \WP_Customize_Cropped_Image_Control( $wp_customize, 'athlonx_front_slideshow_image_4', array( 'section' => 'athlonx_theme_front_slideshow_options', 'label' => '', 'description' => '', 'type' => 'cropped_image', 'flex_width' => false, 'flex_height' => false, 'width' => 900, 'height' => 600, 'priority' => 10, 'setting' => $wp_customize->add_setting( 'athlonx_front_slideshow_image_4', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'esc_html', ) ) ) ); foreach ( $wp_customize_control as $uuid => $wp_customize_control_options ) { $wp_customize->add_control( $wp_customize_control_options ); // $wp_customize->selective_refresh->add_partial( $uuid ); } }, 10, 1 ); add_action( 'init', 'athlonx_theme_customize_options' ); /** * Get and define theme Customizer modificaiton variables. */ function athlonx_theme_customize_options() { $theme_version = wp_get_theme()->get( 'Version' ); $color_palette = esc_html( get_theme_mod( 'athlonx_color_palette', false ) ); $font_family = esc_html( get_theme_mod( 'athlonx_font_family', false ) ); $container_width = esc_html( get_theme_mod( 'athlonx_container_width', false ) ); if ( $color_palette ) { add_action( 'wp_enqueue_scripts', function() use( $color_palette, $theme_version ) { wp_dequeue_style( 'athlonx-style' ); wp_enqueue_style( 'athlonx-style', get_template_directory_uri() . '/assets/css/style-' . $color_palette . '.css', array(), $theme_version, 'all' ); }, 1 ); } if ( $font_family ) { add_action( 'wp_enqueue_scripts', function() use( $font_family, $theme_version ) { wp_dequeue_style( 'google-font-style' ); wp_enqueue_style( 'google-font-style', 'https://fonts.googleapis.com/css?family=' . $font_family . ':300,400,700,900&display=swap', array(), '', 'all' ); }, 1 ); add_action( 'wp_enqueue_scripts', function() use( $font_family, $theme_version ) { wp_add_inline_style( 'athlonx-style', 'html { font-family: ' . $font_family . ', Droid Sans, Helvetica Neue, Helvetica, Arial, -apple-system, BlinkMacSystemFont, sans-serif; }' ); }, 10 ); } if ( $container_width ) { add_action( 'wp_enqueue_scripts', function() use( $container_width, $theme_version ) { wp_add_inline_style( 'athlonx-style', '.container { max-width: ' . $container_width . 'px; } div.post .post-meta, div.post .post-related, .alignfull, .post-comments { margin-left: calc((' . $container_width . 'px - 4rem - 100vw) / 2); } .alignwide { margin-left: calc((' . $container_width . 'px - 4rem - 1440px) / 2); } .footer-gallery .container .widgets { width: ' . ( $container_width - 64 ) . 'px; } @media (max-width: 1200px) { div.post .post-meta, div.post .post-related, .alignfull, .alignwide, .post-comments { margin-left: -2rem; } .footer-gallery .container .widgets { width: calc(100% - 4rem); } }' ); }, 10 ); } } /** * Get list with categories used to display posts for the slideshow content area. */ function get_post_categories() { $output = array(); $categories = get_categories(); foreach( $categories as $category ) { $output[$category->slug] = $category->name; } return $output; }