Exemplo n.º 1
0
    function ct_chosen_social_icons_output()
    {
        // get social sites array
        $social_sites = ct_chosen_social_array();
        // store the site name and url
        foreach ($social_sites as $social_site => $profile) {
            if (strlen(get_theme_mod($social_site)) > 0) {
                $active_sites[$social_site] = $social_site;
            }
        }
        // for each active social site, add it as a list item
        if (!empty($active_sites)) {
            echo "<ul class='social-media-icons'>";
            foreach ($active_sites as $key => $active_site) {
                if ($active_site == 'email') {
                    ?>
		            <li>
			            <a class="email" target="_blank" href="mailto:<?php 
                    echo antispambot(is_email(get_theme_mod($key)));
                    ?>
">
				            <i class="fa fa-envelope" title="<?php 
                    esc_attr(_e('email', 'chosen'));
                    ?>
"></i>
			            </a>
		            </li>
	            <?php 
                } else {
                    ?>
		            <li>
			            <a class="<?php 
                    echo esc_attr($active_site);
                    ?>
" target="_blank" href="<?php 
                    echo esc_url(get_theme_mod($key));
                    ?>
">
				            <i class="fa fa-<?php 
                    echo esc_attr($active_site);
                    ?>
" title="<?php 
                    echo esc_attr($active_site);
                    ?>
"></i>
			            </a>
		            </li>
	            <?php 
                }
            }
            echo "</ul>";
        }
    }
Exemplo n.º 2
0
     public function render_content()
     {
         $link = 'https://www.competethemes.com/chosen-pro/';
         echo "<p>" . sprintf(__('Activate the <a target="_blank" href="%s">Chosen Pro Plugin</a> to change your layout.', 'chosen'), $link) . "</p>";
     }
 }
 /***** Logo Upload *****/
 // section
 $wp_customize->add_section('ct_chosen_logo_upload', array('title' => __('Logo', 'chosen'), 'priority' => 20, 'capability' => 'edit_theme_options'));
 // setting
 $wp_customize->add_setting('logo_upload', array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw'));
 // control
 $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo_image', array('label' => __('Upload custom logo.', 'chosen'), 'section' => 'ct_chosen_logo_upload', 'settings' => 'logo_upload')));
 /***** Social Media Icons *****/
 // get the social sites array
 $social_sites = ct_chosen_social_array();
 // set a priority used to order the social sites
 $priority = 5;
 // section
 $wp_customize->add_section('ct_chosen_social_media_icons', array('title' => __('Social Media Icons', 'chosen'), 'priority' => 25, 'description' => __('Add the URL for each of your social profiles.', 'chosen')));
 // create a setting and control for each social site
 foreach ($social_sites as $social_site => $value) {
     // if email icon
     if ($social_site == 'email') {
         // setting
         $wp_customize->add_setting($social_site, array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'ct_chosen_sanitize_email'));
         // control
         $wp_customize->add_control($social_site, array('label' => __('Email Address', 'chosen'), 'section' => 'ct_chosen_social_media_icons', 'priority' => $priority));
     } else {
         $label = ucfirst($social_site);
         if ($social_site == 'google-plus') {