parent()->get('Version')); wp_enqueue_style( 'bookseller-publication-style', get_stylesheet_uri(), array( $parentcss ), $theme->get('Version')); wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true ); wp_enqueue_script('bookseller-publication-custom-js',get_theme_file_uri() . '/assets/js/custom-script.js', array('jquery'), '', true ); } add_action( 'wp_enqueue_scripts', 'bookseller_publication_enqueue_styles' ); function bookseller_publication_admin_scripts() { // demo CSS wp_enqueue_style( 'bookseller-publication-demo-css', get_theme_file_uri( 'assets/css/demo.css' ) ); } add_action( 'admin_enqueue_scripts', 'bookseller_publication_admin_scripts' ); function bookseller_publication_customize_register($wp_customize){ // Pro Version class Bookseller_Publication_Customize_Pro_Version extends WP_Customize_Control { public $type = 'pro_options'; public function render_content() { echo 'For More '. esc_html( $this->label ) .'?'; echo ''; echo ''; echo ' '. esc_html( DIGITAL_BOOKS_BUY_TEXT,'bookseller-publication' ) .''; echo ''; } } // Custom Controls function Bookseller_Publication_sanitize_custom_control( $input ) { return $input; } //Slider $wp_customize->add_section('bookseller_publication_slider_section',array( 'title' => esc_html__('Slider Setting','bookseller-publication'), 'description' => esc_html__('Here you have to add 3 different Post in below dropdown. Note: Image Dimensions 1400 x 600 px','bookseller-publication'), )); $wp_customize->add_setting('bookseller_publication_slider_per_page', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bookseller_publication_slider_per_page', array( 'label' => __('Slider Count', 'bookseller-publication'), 'section' => 'bookseller_publication_slider_section', 'type' => 'number', )); $categories = get_categories(); $cat_post = array(); $cat_post[]= 'select'; $i = 0; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cat_post[$category->slug] = $category->name; } $wp_customize->add_setting('bookseller_publication_slider_sec_category',array( 'default' => 'select', 'sanitize_callback' => 'digital_books_sanitize_select', )); $wp_customize->add_control('bookseller_publication_slider_sec_category',array( 'type' => 'select', 'choices' => $cat_post, 'label' => __('Select Category to display Slider ','bookseller-publication'), 'section' => 'bookseller_publication_slider_section', )); $wp_customize->add_setting('bookseller_publication_slider_2_per_page', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bookseller_publication_slider_2_per_page', array( 'label' => __('Right Slider Count', 'bookseller-publication'), 'section' => 'bookseller_publication_slider_section', 'type' => 'number', )); $categories = get_categories(); $cat_post = array(); $cat_post[]= 'select'; $i = 0; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cat_post[$category->slug] = $category->name; } $wp_customize->add_setting('bookseller_publication_slider_2_category',array( 'default' => 'select', 'sanitize_callback' => 'digital_books_sanitize_select', )); $wp_customize->add_control('bookseller_publication_slider_2_category',array( 'type' => 'select', 'choices' => $cat_post, 'label' => __('Select Category to display Right Slider','bookseller-publication'), 'section' => 'bookseller_publication_slider_section', )); $wp_customize->add_setting('bookseller_publication_slider_title', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bookseller_publication_slider_title', array( 'label' => __('Title', 'bookseller-publication'), 'section' => 'bookseller_publication_slider_section', 'type' => 'text', )); $wp_customize->add_setting('bookseller_publication_slider_time', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bookseller_publication_slider_time', array( 'label' => __('Time', 'bookseller-publication'), 'section' => 'bookseller_publication_slider_section', 'type' => 'text', )); // Pro Version $wp_customize->add_setting( 'pro_version_slider_setting', array( 'sanitize_callback' => 'Bookseller_Publication_sanitize_custom_control' )); $wp_customize->add_control( new Bookseller_Publication_Customize_Pro_Version ( $wp_customize,'pro_version_slider_setting', array( 'section' => 'bookseller_publication_slider_section', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'bookseller-publication' ), 'description' => esc_url( DIGITAL_BOOKS_URL ), 'priority' => 100 ))); //Latest Product $wp_customize->add_section('bookseller_publication_latest_product',array( 'title' => esc_html__('Latest Product','bookseller-publication'), 'description' => esc_html__('Here you have to select product category which will display perticular latest product in the home page.','bookseller-publication'), )); $wp_customize->add_setting('bookseller_publication_latest_product_title', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bookseller_publication_latest_product_title', array( 'label' => __('Section Title', 'bookseller-publication'), 'section' => 'bookseller_publication_latest_product', 'priority' => 1, 'type' => 'text', )); $wp_customize->add_setting('bookseller_publication_latest_product_sub_title', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bookseller_publication_latest_product_sub_title', array( 'label' => __('Section Sub Title', 'bookseller-publication'), 'section' => 'bookseller_publication_latest_product', 'priority' => 2, 'type' => 'text', )); $wp_customize->add_setting('bookseller_publication_latest_number', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('bookseller_publication_latest_number', array( 'label' => __('Product Count', 'bookseller-publication'), 'section' => 'bookseller_publication_latest_product', 'priority' => 2, 'type' => 'number', )); $args = array( 'type' => 'product', 'child_of' => 0, 'parent' => '', 'orderby' => 'term_group', 'order' => 'ASC', 'hide_empty' => false, 'hierarchical' => 1, 'number' => '', 'taxonomy' => 'product_cat', 'pad_counts' => false ); $categories = get_categories( $args ); $cats = array(); $i = 0; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cats[$category->slug] = $category->name; } $wp_customize->add_setting('bookseller_publication_latest_product',array( 'sanitize_callback' => 'digital_books_sanitize_select', )); $wp_customize->add_control('bookseller_publication_latest_product',array( 'type' => 'select', 'choices' => $cats, 'label' => __('Select Product Category','bookseller-publication'), 'section' => 'bookseller_publication_latest_product', )); } add_action('customize_register', 'bookseller_publication_customize_register'); if ( ! function_exists( 'bookseller_publication_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function bookseller_publication_setup() { add_theme_support( 'responsive-embeds' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded