add_section( 'postpage', array( 'title' => __('Posts & Pages','optimizedlist'), 'priority' => 1, 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'postpage_header', array( 'default' => '#1f1f1f', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_header', array( 'label' => __( 'Headline Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_header', ) ) ); $wp_customize->add_setting( 'postpage_meta', array( 'default' => '#009688', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_meta', array( 'label' => __( 'Meta Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_meta', ) ) ); $wp_customize->add_setting( 'postpage_text', array( 'default' => '#1f1f1f', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_text', array( 'label' => __( 'Text Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_text', ) ) ); $wp_customize->add_setting( 'postpage_link', array( 'default' => '#009688', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_link', array( 'label' => __( 'Link Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_link', ) ) ); $wp_customize->add_setting( 'postpage_border', array( 'default' => '#eee', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_border', array( 'label' => __( 'Border Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_border', ) ) ); $wp_customize->add_setting( 'postpage_button_bg', array( 'default' => '#009688', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_button_bg', array( 'label' => __( 'Button Background Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_button_bg', ) ) ); $wp_customize->add_setting( 'postpage_button_text', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_button_text', array( 'label' => __( 'Button Text Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_button_text', ) ) ); $wp_customize->add_setting( 'postpage_pagination_button_bg', array( 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_pagination_button_bg', array( 'label' => __( 'Pagination Text Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_pagination_button_bg', ) ) ); $wp_customize->add_setting( 'postpage_pagination_button_text', array( 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'postpage_pagination_button_text', array( 'label' => __( 'Pagination Text Color', 'optimizedlist' ), 'section' => 'postpage', 'priority' => 1, 'settings' => 'postpage_pagination_button_text', ) ) ); } add_action( 'customize_register', 'optimizedlist_customize_register' ); if ( ! function_exists( 'optimizedlist_excerpt_more' ) && ! is_admin() ) : /** * Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Read More' link. */ function optimizedlist_excerpt_more( $more ) { $link = sprintf( '
%2$s
', esc_url( get_permalink( get_the_ID() ) ), __( 'Continue reading ', 'optimizedlist' ) ); return '… ' . $link; } add_filter( 'excerpt_more', 'optimizedlist_excerpt_more', 999 ); endif; /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function optimizedlist_customize_preview_js() { wp_enqueue_script( 'optimizedlist-customizer', get_stylesheet_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'optimizedlist_customize_preview_js' ); if(! function_exists('optimizedlist_customizer_styling' ) ): function optimizedlist_customizer_styling(){ ?>