get('Version') ); } add_action( 'wp_enqueue_scripts', 'delect_enqueue_styles' ); // Move the More Link outside from the contents last summary paragraph tag. if ( ! function_exists( 'delect_move_more_link' ) ) : function delect_move_more_link($link) { $link = ''; return $link; } add_filter('the_content_more_link', 'delect_move_more_link'); endif; /** * Change the Twenty Seventeen custom header. * Add our own custom image. */ function delect_default_header() { add_theme_support( 'custom-header', apply_filters( 'delect_custom_header_args', array( 'width' => 2000, 'height' => 1200, 'flex-height' => true, 'video' => true, 'default-image' => get_stylesheet_directory_uri() . '/assets/images/header.jpg', ) ) ); } add_action( 'after_setup_theme', 'delect_default_header' ); /** * Theme Customizer. * @package Delect */ function delect_customize_register( $wp_customize ) { if ( ! class_exists( 'Delect_Customize_Static_Text_Control' ) ){ if ( ! class_exists( 'WP_Customize_Control' ) ) return NULL; class Delect_Customize_Static_Text_Control extends WP_Customize_Control { /** * Control type. * * @access public * @var string */ public $type = 'static-text'; public function __construct( $manager, $id, $args = array() ) { parent::__construct( $manager, $id, $args ); } protected function render_content() { if ( ! empty( $this->label ) ) : ?>label ); ?>description ) ) : ?>
description ) ) { echo '

' . implode( '

', $this->description ) . '

'; } else { echo $this->description; } ?>


add_section( 'delect_upgrade', array( 'title' => esc_html__( 'Upgrade to Pro', 'delect' ), 'priority' => 0 ) ); $wp_customize->add_setting( 'delect_upgrade', array( 'default' => '', 'sanitize_callback' => '__return_false' ) ); $wp_customize->add_control( new Delect_Customize_Static_Text_Control( $wp_customize, 'delect_upgrade', array( 'label' => __('Get The Pro Version:','delect'), 'section' => 'delect_upgrade', 'description' => array('') ) ) ); // social icon color $wp_customize->add_setting( 'delect_social_icon', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_social_icon', array( 'label' => __( 'Social Icon Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_social_icon', ) ) ); // social icon hover color $wp_customize->add_setting( 'delect_social_icon_hover', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_social_icon_hover', array( 'label' => __( 'Social Icon Hover Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_social_icon_hover', ) ) ); // social icon background-color $wp_customize->add_setting( 'delect_social_bg', array( 'default' => '#d8b94f', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_social_bg', array( 'label' => __( 'Social Icon Background', 'delect' ), 'section' => 'colors', 'settings' => 'delect_social_bg', ) ) ); // social icon background-color $wp_customize->add_setting( 'delect_social_bg_hover', array( 'default' => '#bbb', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_social_bg_hover', array( 'label' => __( 'Social Icon Background Hover', 'delect' ), 'section' => 'colors', 'settings' => 'delect_social_bg_hover', ) ) ); // read more bg $wp_customize->add_setting( 'delect_bg_morelink', array( 'default' => '#e1b401', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_bg_morelink', array( 'label' => __( 'Continue Reading Background Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_bg_morelink', ) ) ); // read more link $wp_customize->add_setting( 'delect_morelink', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_morelink', array( 'label' => __( 'Continue Reading Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_morelink', ) ) ); // sidebar list text colour $wp_customize->add_setting( 'delect_widget_list_colour', array( 'default' => '#787d85', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_widget_list_colour', array( 'label' => __( 'Widget List Link Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_widget_list_colour', ) ) ); // sidebar list link hover colour $wp_customize->add_setting( 'delect_widget_list_hover_colour', array( 'default' => '#000', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_widget_list_hover_colour', array( 'label' => __( 'Widget List Link Hover Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_widget_list_hover_colour', ) ) ); // sidebar list borders $wp_customize->add_setting( 'delect_widget_list_border', array( 'default' => '#e6e6e6', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_widget_list_border', array( 'label' => __( 'Widget List Border Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_widget_list_border', ) ) ); // sticky label color $wp_customize->add_setting( 'delect_sticky_label', array( 'default' => '#c3a12d', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_sticky_label', array( 'label' => __( 'Featured Label Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_sticky_label', ) ) ); // entry title hover $wp_customize->add_setting( 'delect_post_title_hover', array( 'default' => '#659ebd', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'delect_post_title_hover', array( 'label' => __( 'Post Title Hover Colour', 'delect' ), 'section' => 'colors', 'settings' => 'delect_post_title_hover', ) ) ); // Setting group for a Copyright $wp_customize->add_setting( 'copyright', array( 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'copyright', array( 'settings' => 'copyright', 'label' => __( 'Your Copyright Name', 'delect' ), 'section' => 'theme_options', 'type' => 'text', 'priority' => 20, ) ); } add_action( 'customize_register', 'delect_customize_register' ); // Custom Inline styles function delect_inline_styles($custom) { $delect_site_title = get_theme_mod( 'delect_site_title', '#fff' ); $delect_social_bg = get_theme_mod( 'delect_social_bg', '#d8b94f' ); $delect_social_bg_hover = get_theme_mod( 'delect_social_bg_hover', '#bbb' ); $delect_social_icon = get_theme_mod( 'delect_social_icon', '#fff' ); $delect_social_icon_hover = get_theme_mod( 'delect_social_icon_hover', '#fff' ); $delect_post_title_hover = get_theme_mod( 'delect_post_title_hover', '#659ebd' ); $delect_bg_morelink = get_theme_mod( 'delect_bg_morelink', '#e1b401' ); $delect_morelink = get_theme_mod( 'delect_morelink', '#fff' ); $delect_widget_list_colour = get_theme_mod( 'delect_widget_list_colour', '#787d85' ); $delect_widget_list_hover_colour = get_theme_mod( 'delect_widget_list_hover_colour', '#000' ); $delect_widget_list_border = get_theme_mod( 'delect_widget_list_border', '#e6e6e6' ); $delect_sticky_bg = get_theme_mod( 'delect_sticky_bg', '#659ebd' ); $delect_sticky_label = get_theme_mod( 'delect_sticky_label', '#c3a12d' ); $delect_links = get_theme_mod( 'delect_links', '#4e9eca' ); $custom .= ".site-branding .site-title a,.site-branding .site-title a:hover,.site-branding .site-title a:focus {color: " . esc_attr($delect_site_title) . "; } .entry-title a:hover, .entry-title a:focus, .post-navigation a:hover .post-title,.post-navigation a:focus .post-title {color: " . esc_attr($delect_post_title_hover) . "!important; } .entry-content a.more-link, .entry-summary a.more-link {background-color: " . esc_attr($delect_bg_morelink) . "; color: " . esc_attr($delect_morelink) . "; } .social-navigation a {background-color: " . esc_attr($delect_social_bg) . "!important; color: " . esc_attr($delect_social_icon) . "!important; } .social-navigation a:hover { background-color: " . esc_attr($delect_social_bg_hover) . "!important; color: " . esc_attr($delect_social_icon_hover) . "; } .widget ul li, .widget ol li, .widget ul li, .colors-dark .widget ol li { border-color: " . esc_attr($delect_widget_list_border) . "!important; color: " . esc_attr($delect_widget_list_colour) . ";} .widget li a, .widget li a:visited {color: " . esc_attr($delect_widget_list_colour) . ";} .widget ul li a:focus,.widget ul li a:hover, .colors-dark .widget ul li a:hover {color: " . esc_attr($delect_widget_list_hover_colour) . "!important;} .featured-label {color: " . esc_attr($delect_sticky_label) . ";} a, .comment-reply-link, .comment-reply-link:hover,.comment-reply-link:focus {color: " . esc_attr($delect_links) . ";} "."\n"; //Output all the styles wp_add_inline_style( 'delect-style', $custom ); } add_action( 'wp_enqueue_scripts', 'delect_inline_styles' );