add_setting('center_header_text', array( 'default' => 1, 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('center_header_text', array( 'label' => __('Center Header Text', 'adaptable-notes'), 'section' => 'header_image', 'priority' => 0, 'settings' => 'center_header_text', 'type' => 'checkbox', )); $wp_customize->add_setting('primary_theme_color', array( 'default' => '#fab526', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'primary_theme_color', array( 'label' => __('Primary Theme Color', 'adaptable-notes'), 'section' => 'theme_color', 'priority' => 1, 'settings' => 'primary_theme_color', ))); $wp_customize->add_section('colors', array( 'title' => __('Background Color', 'adaptable-notes'), 'priority' => 150, 'capability' => 'edit_theme_options', )); $wp_customize->add_section('static_front_page', array( 'title' => __('Static Front Page', 'adaptable-notes'), 'priority' => 150, 'capability' => 'edit_theme_options', )); $wp_customize->add_section('sidebars_settings', array( 'title' => __('Sidebar', 'adaptable-notes'), 'priority' => 100, 'capability' => 'edit_theme_options', )); $wp_customize->add_section('all_blog_posts', array( 'title' => __('All Blog Posts', 'adaptable-notes'), 'priority' => 100, 'capability' => 'edit_theme_options', )); $wp_customize->add_section('customizable_blogily_header_settings', array( 'title' => __('Header', 'adaptable-notes'), 'priority' => 122, 'capability' => 'edit_theme_options', )); $wp_customize->add_section('navigation_settings', array( 'title' => __('Navigation Settings', 'adaptable-notes'), 'priority' => 50, 'capability' => 'edit_theme_options', )); $wp_customize->add_section('upper_widgets_settings', array( 'title' => __('Top Widget Settings', 'adaptable-notes'), 'priority' => 50, 'capability' => 'edit_theme_options', )); /***************************************************/ /***** pagination ****/ /**************************************************/ $wp_customize->add_section('customizable_blogily_pagination_settings', array( 'title' => __('Pagination Type', 'adaptable-notes'), 'priority' => 122, 'capability' => 'edit_theme_options', )); $wp_customize->add_setting('customizable_blogily_pagination_type', array( 'default' => '1', 'capability' => 'edit_theme_options', 'priority' => 1, 'sanitize_callback' => 'adaptable_notes_sanitize_select', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'customizable_blogily_pagination_type', array( 'label' => __('Pagination Type', 'adaptable-notes'), 'section' => 'all_blog_posts', 'settings' => 'customizable_blogily_pagination_type', 'type' => 'radio', 'choices' => array( '0' => __('Next/Previous', 'adaptable-notes'), '1' => __('Numbered', 'adaptable-notes'), ), 'transport' => 'refresh', 'priority' => 99, ) ) ); $wp_customize->add_setting('all_blog_posts_headline', array( 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'all_blog_posts_headline', array( 'label' => __('Headline Colors', 'adaptable-notes'), 'section' => 'all_blog_posts', 'priority' => 1, 'settings' => 'all_blog_posts_headline', ))); $wp_customize->add_setting('all_blog_posts_date', array( 'default' => '#8c8c8c', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'all_blog_posts_date', array( 'label' => __('Date Colors', 'adaptable-notes'), 'section' => 'all_blog_posts', 'priority' => 1, 'settings' => 'all_blog_posts_date', ))); $wp_customize->add_setting('all_blog_posts_text', array( 'default' => '#989898', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'all_blog_posts_text', array( 'label' => __('Text Colors', 'adaptable-notes'), 'section' => 'all_blog_posts', 'priority' => 1, 'settings' => 'all_blog_posts_text', ))); $wp_customize->add_setting('all_blog_posts_bg', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'all_blog_posts_bg', array( 'label' => __('Background Color', 'adaptable-notes'), 'section' => 'all_blog_posts', 'priority' => 1, 'settings' => 'all_blog_posts_bg', ))); //Breadcrumb $wp_customize->add_setting('customizable_blogily_single_breadcrumb_section', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'adaptable_notes_sanitize_select', 'transport' => 'refresh', 'default' => '1', )); $wp_customize->add_control('customizable_blogily_single_breadcrumb_section', array( 'label' => __('Breadcrumb Section', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'description' => __('This setting will only affect blog posts.', 'adaptable-notes'), 'settings' => 'customizable_blogily_single_breadcrumb_section', 'type' => 'radio', 'choices' => array( '1' => __('OFF', 'adaptable-notes'), '0' => __('ON', 'adaptable-notes'), ), )); //Tags $wp_customize->add_setting('customizable_blogily_single_tags_section', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'adaptable_notes_sanitize_select', 'transport' => 'refresh', 'default' => '1', )); $wp_customize->add_control('customizable_blogily_single_tags_section', array( 'label' => __('Tags Section', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'description' => __('This setting will only affect blog posts.', 'adaptable-notes'), 'settings' => 'customizable_blogily_single_tags_section', 'type' => 'radio', 'choices' => array( '0' => __('OFF', 'adaptable-notes'), '1' => __('ON', 'adaptable-notes'), ), )); //Related Posts $wp_customize->add_setting('customizable_blogily_relatedposts_section', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'adaptable_notes_sanitize_select', 'transport' => 'refresh', 'default' => '1', )); $wp_customize->add_control('customizable_blogily_relatedposts_section', array( 'label' => __('Related Posts Section', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'description' => __('This setting will only affect blog posts.', 'adaptable-notes'), 'settings' => 'customizable_blogily_relatedposts_section', 'type' => 'radio', 'choices' => array( '1' => __('OFF', 'adaptable-notes'), '0' => __('ON', 'adaptable-notes'), ), )); //Author Box $wp_customize->add_setting('customizable_blogily_authorbox_section', array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'adaptable_notes_sanitize_select', 'transport' => 'refresh', 'default' => '1', )); $wp_customize->add_control('customizable_blogily_authorbox_section', array( 'label' => __('Author box Section', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'description' => __('This setting will only affect blog posts.', 'adaptable-notes'), 'settings' => 'customizable_blogily_authorbox_section', 'type' => 'radio', 'choices' => array( '1' => __('OFF', 'adaptable-notes'), '0' => __('ON', 'adaptable-notes'), ), )); $wp_customize->add_setting('post_page_headline', array( 'default' => '#000', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'post_page_headline', array( 'label' => __('Headline Colors', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'priority' => 1, 'settings' => 'post_page_headline', ))); $wp_customize->add_setting('post_page_date', array( 'default' => '#a2a2a2', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'post_page_date', array( 'label' => __('Date Colors', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'description' => __('This setting will only affect blog posts.', 'adaptable-notes'), 'priority' => 1, 'settings' => 'post_page_date', ))); $wp_customize->add_setting('post_page_text', array( 'default' => '#555555', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'post_page_text', array( 'label' => __('Text Colors', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'priority' => 1, 'settings' => 'post_page_text', ))); $wp_customize->add_setting('post_page_link', array( 'default' => '#fab526', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'post_page_link', array( 'label' => __('Link Colors', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'priority' => 1, 'settings' => 'post_page_link', ))); $wp_customize->add_setting('post_page_background', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'post_page_background', array( 'label' => __('Background Color', 'adaptable-notes'), 'section' => 'customizable_single_settings', 'priority' => 1, 'settings' => 'post_page_background', ))); } add_action('customize_register', 'adaptable_notes_customize_register'); if (! function_exists('adaptable_notes_color_choice')): function adaptable_notes_color_choice() { ?> manager->get_control($setting->id)->choices; // If the input is a valid key, return it; otherwise, return the default. return (array_key_exists($input, $choices) ? $input : $setting->default); } /** * This file represents an example of the code that themes would use to register * the required plugins. * * It is expected that theme authors would copy and paste this code into their * functions.php file, and amend to suit. * * @see http://tgmpluginactivation.com/configuration/ for detailed documentation. * * @package TGM-Plugin-Activation * @subpackage Example * @version 2.6.1 for child theme Adaptable Notes for publication on WordPress.org * @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer * @copyright Copyright (c) 2011, Thomas Griffin * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later * @link https://github.com/TGMPA/TGM-Plugin-Activation */ /** * Include the TGM_Plugin_Activation class. * * Depending on your implementation, you may want to change the include call: * * Parent Theme: * require_once get_template_directory() . '/tgm/class-tgm-plugin-activation.php'; * * Child Theme: * require_once get_stylesheet_directory() . '/tgm/class-tgm-plugin-activation.php'; * * Plugin: * require_once dirname( __FILE__ ) . '/tgm/class-tgm-plugin-activation.php'; */ require_once get_stylesheet_directory() . '/tgm/class-tgm-plugin-activation.php'; add_action( 'tgmpa_register', 'adaptable_notes_register_required_plugins' ); /** * Register the required plugins for this theme. * * In this example, we register five plugins: * - one included with the TGMPA library * - two from an external source, one from an arbitrary source, one from a GitHub repository * - two from the .org repo, where one demonstrates the use of the `is_callable` argument * * The variables passed to the `tgmpa()` function should be: * - an array of plugin arrays; * - optionally a configuration array. * If you are not changing anything in the configuration array, you can remove the array and remove the * variable from the function call: `tgmpa( $plugins );`. * In that case, the TGMPA default settings will be used. * * This function is hooked into `tgmpa_register`, which is fired on the WP `init` action on priority 10. */ function adaptable_notes_register_required_plugins() { /* * Array of plugin arrays. Required keys are name and slug. * If the source is NOT from the .org repo, then source is also required. */ $plugins = array( array( 'name' => 'Social Share & Follow Buttons', 'slug' => 'superb-social-share-and-follow-buttons', 'required' => false, ), ); $config = array( 'id' => 'adaptable-notes', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); }