add_panel( 'agama_blue_panel', array(
'title' => __( 'Agama Blue Options', 'agama-blue' ),
'description' => __( 'Agama blue theme options.', 'agama-blue' ),
'capability' => 'edit_theme_options',
'priority' => 130
) ); // Blog Section
$wp_customize->add_section( 'agama_blue_blog_section', array(
'title' => __( 'Blog', 'agama-blue' ),
'description' => __( 'Blog settings.', 'agama-blue' ),
'panel' => 'agama_blue_panel'
) ); // Agama Blue blog feature
$wp_customize->add_setting( 'agama_blue_blog', array(
'default' => true,
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'agama_blue_blog', array(
'label' => __( 'Enable blog feature ?', 'agama-blue' ),
'description' => __( 'Enable blog feature on homepage.', 'agama-blue' ),
'section' => 'agama_blue_blog_section',
'settings' => 'agama_blue_blog',
'type' => 'checkbox'
)
)
); // Blog Heading
$wp_customize->add_setting( 'agama_blue_blog_heading', array(
'default' => 'Latest from the Blog',
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'agama_blue_blog_heading', array(
'label' => __( 'Blog Heading', 'agama-blue' ),
'description' => __( 'Set custom blog section heading title.', 'agama-blue' ),
'section' => 'agama_blue_blog_section',
'settings' => 'agama_blue_blog_heading',
'type' => 'text'
)
)
); // Blog Posts Heading
$wp_customize->add_setting( 'agama_blue_blog_posts_number', array(
'default' => '4',
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize, 'agama_blue_blog_posts_number', array(
'label' => __( 'Blog Posts', 'agama' ),
'description' => __( 'Enter how many blog posts should appear on blog section on homepage.', 'agama-blue' ),
'section' => 'agama_blue_blog_section',
'settings' => 'agama_blue_blog_posts_number',
'type' => 'text'
)
)
);
}
add_action( 'customize_register', 'agama_blue_customize_register' );
/**
* Generating Dynamic CSS
*
* @since 1.0.1
*/
function agama_blue_customize_css() { ?>