'post', 'posts_per_page' => absint($number_of_posts), 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC', 'ignore_sticky_posts' => true ); $category = isset($category) ? $category : '0'; if (absint($category) > 0) { $ins_args['cat'] = absint($category); } $all_posts = new \WP_Query($ins_args); return $all_posts; } endif; /** * Option Panel * * @package blogxo */ function blogxo_customize_register($wp_customize) { /** * Customize Control for Radio Image. * * @since 1.0.0 * * @see WP_Customize_Control */ class Blogxo_Radio_Image_Control extends WP_Customize_Control { /** * Declare the control type. * * @access public * @var string */ public $type = 'radio-image'; /** * Enqueue scripts and styles for the custom control. * * Scripts are hooked at {@see 'customize_controls_enqueue_scripts'}. * * Note, you can also enqueue stylesheets here as well. Stylesheets are hooked * at 'customize_controls_print_styles'. * * @access public */ public function enqueue() { wp_enqueue_script( 'jquery-ui-button' ); } /** * Render the control to be displayed in the Customizer. */ public function render_content() { if ( empty( $this->choices ) ) { return; } $name = '_customize-radio-' . $this->id; ?> label ); ?> description ) ) : ?> description ); ?>
choices as $value => $label ): ?> link(); checked( $this->value(), $value ); ?>>
add_setting('blogxo_title_font_size', array( 'default' => 60, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', 'priority' => 50, ) ); $wp_customize->add_control('blogxo_title_font_size', array( 'label' => esc_html__('Site Title Size', 'blogxo'), 'section' => 'title_tagline', 'type' => 'number', ) ); //================================= // Trending Posts Section. //================================= $wp_customize->remove_section( 'frontpage_advertisement_settings'); $wp_customize->remove_section( 'blogarise_featured_links_section'); $wp_customize->remove_setting( 'background_color'); $wp_customize->remove_setting( 'slider_tabs'); $wp_customize->remove_control( 'blogarise_content_layout'); $wp_customize->add_setting('blogarise_slider_title_font_size', array( 'default' => 32, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control('blogarise_slider_title_font_size', array( 'label' => esc_html__('Slider title font Size', 'blogxo'), 'section' => 'frontpage_main_banner_section_settings', 'type' => 'number', ) ); $wp_customize->add_setting( 'background_color', array( 'sanitize_callback' => 'sanitize_text_field', 'default' => 'fff', ) ); $wp_customize->add_control( 'background_color', array( 'type' => 'color', 'label' => __('Background Color', 'blogxo' ), 'section' => 'colors', 'priority' => 2, ) ); $wp_customize->add_setting( 'slider_tabs', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', 'priority' => 1, ) ); $wp_customize->add_control( new Custom_Tab_Control ( $wp_customize,'slider_tabs', array( 'label' => '', 'type' => 'custom-tab-control', 'section' => 'frontpage_main_banner_section_settings', 'controls_general' => json_encode ( array( '#customize-control-select_slider_news_category', '#customize-control-show_main_news_section', '#customize-control-trending_post_section_title', '#customize-control-select_trending_post_category', ) ), 'controls_design' => json_encode (array( '#customize-control-slider_overlay_enable', '#customize-control-blogarise_slider_overlay_color', '#customize-control-blogarise_slider_overlay_text_color', '#customize-control-blogarise_slider_title_font_size', '#customize-control-slider_meta_enable', ) ), ) )); // Setting - show_main_news_section. $wp_customize->add_setting('show_main_news_section', array( 'default' => 1, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'blogarise_sanitize_checkbox', ) ); $wp_customize->add_control('show_main_news_section', array( 'label' => esc_html__('Enable Slider Banner Section', 'blogxo'), 'section' => 'frontpage_main_banner_section_settings', 'type' => 'checkbox', 'priority' => 10, ) ); //trending Post Section //section title $wp_customize->add_setting('trending_post_section_title', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Blogarise_Section_Title($wp_customize, 'trending_post_section_title', array( 'label' => esc_html__( 'Trending Post Section', 'blogxo' ), 'section' => 'frontpage_main_banner_section_settings', 'active_callback' => 'blogarise_main_banner_section_status', 'priority' => 100 ) )); // Setting - drop down category for slider. $wp_customize->add_setting('select_trending_post_category', array( 'default' => 0, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint', ) ); $wp_customize->add_control(new Blogarise_Dropdown_Taxonomies_Control($wp_customize, 'select_trending_post_category', array( 'label' => esc_html__('Category', 'blogxo'), 'description' => esc_html__('Posts to be shown on trending post section', 'blogxo'), 'section' => 'frontpage_main_banner_section_settings', 'type' => 'dropdown-taxonomies', 'taxonomy' => 'category', 'active_callback' => 'blogarise_main_banner_section_status', 'priority' => 100, ) )); $wp_customize->add_setting( 'blogarise_content_layout', array( 'default' => 'grid-right-sidebar', 'sanitize_callback' => 'blogarise_sanitize_radio', ) ); $wp_customize->add_control( new Blogxo_Radio_Image_Control( // $wp_customize object $wp_customize, // $id 'blogarise_content_layout', // $args array( 'settings' => 'blogarise_content_layout', 'section' => 'blog_layout_section', 'priority' => 50, 'choices' => array( 'align-content-left' => get_template_directory_uri() . '/images/fullwidth-left-sidebar.png', 'full-width-content' => get_template_directory_uri() . '/images/fullwidth.png', 'align-content-right' => get_template_directory_uri() . '/images/right-sidebar.png', 'grid-left-sidebar' => get_template_directory_uri() . '/images/grid-left-sidebar.png', 'grid-fullwidth' => get_template_directory_uri() . '/images/grid-fullwidth.png', 'grid-right-sidebar' => get_template_directory_uri() . '/images/grid-right-sidebar.png', ) ) ) ); } add_action('customize_register', 'blogxo_customize_register');