Ejemplo n.º 1
0
    </div>
	<footer id="footer-main" role="contentinfo">
		<?php 
if (ale_get_option('copyrights')) {
    ?>
			<p class="copy"><?php 
    echo ale_option('copyrights');
    ?>
</p>
		<?php 
} else {
    ?>
			<p class="copy">&copy; <?php 
    _e('2014. Socha Responsive Theme. ALL RIGHTS RESERVED.', 'aletheme');
    ?>
</p>
		<?php 
}
?>
        <div class="topbutton">
            <a href="#top" id="gotop"><?php 
_e('TOP', 'aletheme');
?>
</a>
        </div>
        <div class="cf"></div>
	</footer>
<?php 
wp_footer();
?>
Ejemplo n.º 2
0
/**
 * Add Open Graph Tags to <head> 
 */
function ale_og_meta()
{
    if (ale_get_option('og_enabled')) {
        $og_type = 'article';
        $og_locale = get_locale();
        $og_image = '';
        // single page
        if (is_singular()) {
            global $post;
            $og_title = esc_attr(strip_tags(stripslashes($post->post_title)));
            $og_url = get_permalink();
            if (trim($post->post_excerpt) != '') {
                $og_desc = trim($post->post_excerpt);
            } else {
                $og_desc = ale_truncate(strip_tags($post->post_content), 240, '...');
            }
            $og_image = ale_get_og_meta_image();
            if (is_front_page()) {
                $og_type = 'website';
            }
        } else {
            global $wp_query;
            $og_title = get_bloginfo('name');
            $og_url = site_url();
            $og_desc = get_bloginfo('description');
            if (is_front_page()) {
                $og_type = 'website';
            } elseif (is_category()) {
                $og_title = esc_attr(strip_tags(stripslashes(single_cat_title('', false))));
                $term = $wp_query->get_queried_object();
                $og_url = get_term_link($term, $term->taxonomy);
                $cat_desc = trim(esc_attr(strip_tags(stripslashes(category_description()))));
                if ($cat_desc) {
                    $og_desc = $cat_desc;
                }
            } elseif (is_tag()) {
                $og_title = esc_attr(strip_tags(stripslashes(single_tag_title('', false))));
                $term = $wp_query->get_queried_object();
                $og_url = get_term_link($term, $term->taxonomy);
                $tag_desc = trim(esc_attr(strip_tags(stripslashes(tag_description()))));
                if (trim($tag_desc) != '') {
                    $og_desc = $tag_desc;
                }
            } elseif (is_tax()) {
                $og_title = esc_attr(strip_tags(stripslashes(single_term_title('', false))));
                $term = $wp_query->get_queried_object();
                $og_url = get_term_link($term, $term->taxonomy);
            } elseif (is_search()) {
                $og_title = esc_attr(strip_tags(stripslashes(__('Search for', 'aletheme') . ' "' . get_search_query() . '"')));
                $og_url = get_search_link();
            } elseif (is_author()) {
                $og_title = esc_attr(strip_tags(stripslashes(get_the_author_meta('display_name', get_query_var('author')))));
                $og_url = get_author_posts_url(get_query_var('author'), get_query_var('author_name'));
            } elseif (is_archive()) {
                if (is_post_type_archive()) {
                    $og_title = esc_attr(strip_tags(stripslashes(post_type_archive_title('', false))));
                    $og_url = get_post_type_archive_link(get_query_var('post_type'));
                } elseif (is_day()) {
                    $og_title = esc_attr(strip_tags(stripslashes(get_query_var('day') . ' ' . single_month_title(' ', false) . ' ' . __('Archives', 'aletheme'))));
                    $og_url = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day'));
                } elseif (is_month()) {
                    $og_title = esc_attr(strip_tags(stripslashes(single_month_title(' ', false) . ' ' . __('Archives', 'aletheme'))));
                    $og_url = get_month_link(get_query_var('year'), get_query_var('monthnum'));
                } elseif (is_year()) {
                    $og_title = esc_attr(strip_tags(stripslashes(get_query_var('year') . ' ' . __('Archives', 'aletheme'))));
                    $og_url = get_year_link(get_query_var('year'));
                }
            } else {
                // other situations
            }
        }
        if (!$og_desc) {
            $og_desc = $og_title;
        }
        ?>
	
	<?php 
        if (ale_get_option('fb_id')) {
            ?>
		<meta property="fb:app_id" content="<?php 
            ale_option('fb_id');
            ?>
" />
	<?php 
        }
        ?>
	<?php 
        if ($og_image) {
            ?>
		<meta property="og:image" content="<?php 
            echo $og_image;
            ?>
" />
	<?php 
        }
        ?>
	<meta property="og:locale" content="<?php 
        echo $og_locale;
        ?>
 " />
	<meta property="og:site_name" content="<?php 
        bloginfo('name');
        ?>
" />
	<meta property="og:title" content="<?php 
        echo $og_title;
        ?>
" />
	<meta property="og:url" content="<?php 
        echo $og_url;
        ?>
" />	
	<meta property="og:type" content="<?php 
        echo $og_type;
        ?>
" />
	<meta property="og:description" content="<?php 
        echo $og_desc;
        ?>
" />
	<?php 
    }
}