Exemplo n.º 1
0
function barcelona_header_custom_code()
{
    $barcelona_extra_fonts = array();
    if (is_active_widget(false, false, 'barcelona-about-me')) {
        $barcelona_extra_fonts = array('Old+Standard+TT');
    }
    $barcelona_font = barcelona_get_font($barcelona_extra_fonts);
    $barcelona_background = barcelona_get_background();
    $barcelona_options = barcelona_get_options(array('apple_touch_icon_iphone', 'apple_touch_icon_ipad', 'apple_touch_icon_retina', 'favicon_url', 'header_custom_code', 'css_custom_code', 'selection_color', 'facebook_app_id', 'add_facebook_og_tags'));
    if (!empty($barcelona_options['apple_touch_icon_iphone'])) {
        echo '<link rel="apple-touch-icon-precomposed" sizes="57x57" href="' . esc_url($barcelona_options['apple_touch_icon_iphone']) . '" />' . "\n";
    }
    if (!empty($barcelona_options['apple_touch_icon_ipad'])) {
        echo '<link rel="apple-touch-icon-precomposed" sizes="72x72" href="' . esc_url($barcelona_options['apple_touch_icon_ipad']) . '" />' . "\n";
    }
    if (!empty($barcelona_options['apple_touch_icon_retina'])) {
        echo '<link rel="apple-touch-icon-precomposed" sizes="144x144" href="' . esc_url($barcelona_options['apple_touch_icon_retina']) . '" />' . "\n";
    }
    if (!empty($barcelona_options['favicon_url'])) {
        echo '<link rel="icon" href="' . esc_url($barcelona_options['favicon_url']) . '" />' . "\n";
    }
    if ($barcelona_options['add_facebook_og_tags'] == 'on' && is_singular()) {
        global $post;
        $barcelona_author_social_links = barcelona_get_author_social_links($post->post_author);
        ?>
		<meta property="og:title" content="<?php 
        echo esc_attr($post->post_title);
        ?>
" />
		<meta property="og:site_name" content="<?php 
        echo esc_attr(get_bloginfo('name'));
        ?>
" />
		<meta property="og:url" content="<?php 
        echo esc_url(get_the_permalink($post->ID));
        ?>
" />
		<meta property="og:description" content="<?php 
        echo esc_attr(barcelona_get_excerpt(60));
        ?>
" />
		<?php 
        if (!empty($barcelona_options['facebook_app_id'])) {
            ?>
		<meta property="fb:app_id" content="<?php 
            echo esc_attr($barcelona_options['facebook_app_id']);
            ?>
" />
		<?php 
        }
        ?>
		<meta property="og:type" content="article" />
		<meta property="og:locale" content="<?php 
        echo esc_attr(barcelona_get_locale());
        ?>
" />
		<?php 
        if (has_post_thumbnail()) {
            ?>
		<meta property="og:image" content="<?php 
            barcelona_thumbnail_url('barcelona-lg');
            ?>
" />
		<?php 
            if (array_key_exists('facebook', $barcelona_author_social_links)) {
                ?>
		<meta property="article:author" content="<?php 
                echo esc_url($barcelona_author_social_links['facebook']['href']);
                ?>
" />
		<meta property="article:publisher" content="<?php 
                echo esc_url($barcelona_author_social_links['facebook']['href']);
                ?>
" />
		<?php 
            }
            ?>
		<?php 
        }
    }
    // Add header custom code
    if (!empty($barcelona_options['header_custom_code'])) {
        // We trust the author here. The author can add custom html to header.
        echo $barcelona_options['header_custom_code'] . "\n";
    }
    // Add body & heading font styles
    echo wp_kses($barcelona_font[1], array('style' => array('type' => array()))) . "\n";
    if (!empty($barcelona_background)) {
        $barcelona_options['css_custom_code'] .= "\n" . $barcelona_background;
    }
    if (!empty($barcelona_options['selection_color'])) {
        $barcelona_options['css_custom_code'] .= "\n::-moz-selection { background-color: " . esc_html($barcelona_options['selection_color']) . "; }\n::selection { background-color: " . esc_html($barcelona_options['selection_color']) . "; }";
    }
    // Add css custom code
    if (!empty($barcelona_options['css_custom_code'])) {
        echo "<style type=\"text/css\">\n" . esc_html($barcelona_options['css_custom_code']) . "\n</style>\n";
    }
}
Exemplo n.º 2
0
" target="_blank" title="<?php 
                printf(esc_html__('Share on %s', 'barcelona'), 'Twitter');
                ?>
"><span class="fa fa-twitter"></span></a></li>
							<li><a href="https://plus.google.com/share?url=<?php 
                echo urlencode(get_the_permalink());
                ?>
" target="_blank" title="<?php 
                printf(esc_html__('Share on %s', 'barcelona'), 'Google+');
                ?>
"><span class="fa fa-google-plus"></span></a></li>
							<li><a href="https://pinterest.com/pin/create/button/?url=<?php 
                echo urlencode(get_the_permalink());
                ?>
&amp;media=<?php 
                barcelona_thumbnail_url('barcelona-lg');
                ?>
&amp;description=<?php 
                echo urlencode(get_the_title());
                ?>
" target="_blank" title="<?php 
                printf(esc_html__('Share on %s', 'barcelona'), 'Pinterest');
                ?>
"><span class="fa fa-pinterest"></span></a></li>
							<li><a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=<?php 
                echo urlencode(get_the_permalink());
                ?>
&amp;title=<?php 
                echo urlencode(get_the_title());
                ?>
&amp;summary=<?php 
Exemplo n.º 3
0
					<?php 
    barcelona_psum_overlay();
    if ($barcelona_counter == 0) {
        ?>
						<picture>
							<!--[if IE 9]><video style="display: none;"><![endif]-->
							<source srcset="<?php 
        barcelona_thumbnail_url('barcelona-md-vertical');
        ?>
" media="(min-width: 768px)" />
							<!--[if IE 9]></video><![endif]-->
							<img src="<?php 
        barcelona_thumbnail_url('barcelona-md');
        ?>
" srcset="<?php 
        barcelona_thumbnail_url('barcelona-md');
        ?>
" alt="<?php 
        echo esc_attr(get_the_title());
        ?>
" />
						</picture>
						<?php 
    } else {
        barcelona_thumbnail('barcelona-xs');
    }
    ?>
				</a>

			</div><!-- .post-image -->