Skip to content

Instantly share code, notes, and snippets.

@lizkaraffa
Last active September 29, 2015 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lizkaraffa/4ed4b6cba0a30bd49b8d to your computer and use it in GitHub Desktop.
Save lizkaraffa/4ed4b6cba0a30bd49b8d to your computer and use it in GitHub Desktop.
function swell_theme_customizer( $wp_customize ) {
//-------------------------------------------------------------------------------------------------------------------//
// Page Templates
//-------------------------------------------------------------------------------------------------------------------//
$wp_customize->add_section( 'swell_templates_section' , array(
'title' => __( 'Page Templates', 'swelltheme' ),
'priority' => 103,
) );
// Featured Page Left
$wp_customize->add_setting( 'page_one', array(
'default' => '2',
'sanitize_callback' => 'swell_sanitize_pages',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'page_one', array(
'label' => __( 'Home Template Page Left', 'swelltheme' ),
'section' => 'swell_templates_section',
'settings' => 'page_one',
'post_type' => 'program',
'type' => 'dropdown-pages',
'priority' => 20,
) ) );
// Featured Page Middle
$wp_customize->add_setting( 'page_two', array(
'default' => '2',
'sanitize_callback' => 'swell_sanitize_pages',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'page_two', array(
'label' => __( 'Home Template Page Mid', 'swelltheme' ),
'section' => 'swell_templates_section',
'settings' => 'page_two',
'post_type' => 'program',
'type' => 'dropdown-pages',
'priority' => 40,
) ) );
// Featured Page Right
$wp_customize->add_setting( 'page_three', array(
'default' => '2',
'sanitize_callback' => 'swell_sanitize_pages',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'page_three', array(
'label' => __( 'Home Template Page Right', 'swelltheme' ),
'section' => 'swell_templates_section',
'settings' => 'page_three',
'post_type' => 'program',
'type' => 'dropdown-pages',
'priority' => 60,
) ) );
}
add_action('customize_register', 'swell_theme_customizer');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment