</figure> <?php } ?> </div> <div class="post-data"> <div class="post-data-text"> <div class="title-post title"><a href="<?php the_permalink(); ?> "><?php echo ale_truncate(get_the_title(), 40); ?> </a></div> <div class="desc-post"><?php echo ale_truncate(get_the_excerpt(), 220); ?> </div> <div class="post-meta"> <span class="date-box"><?php echo get_the_date(); ?> </span> <span class="comm-box"><?php echo get_comments_number(); ?> </span> </div> </div> </div> </div>
?> "> <?php if (get_the_post_thumbnail($post->ID)) { echo get_the_post_thumbnail($post->ID, 'gallery-smallitemthumb'); } else { echo '<img src="http://placehold.it/505x370&text=No+Thumb" alt="' . get_the_title() . '" />'; } ?> </a> <figcaption class="mask-text"> <div class="mask-title title"><a href="<?php the_permalink(); ?> "><?php echo ale_truncate(get_the_title(), 25); ?> </a></div> <div class="mask-cat title"> <?php $current_category = wp_get_post_terms($post->ID, 'gallery-category', array("fields" => "all")); if ($current_category) { foreach ($current_category as $curcat) { echo $curcat->name . ' '; } } ?> </div> </figcaption> <div class="link-box"> <a href="<?php
?> <div class="line-post cf"> <div class="white-box-post cf"> <div class="title-box"><a href="<?php the_permalink(); ?> "><?php echo ale_truncate(get_the_title(), 25); ?> </a></div> <div class="cat-box"><?php the_category(', '); ?> </div> <div class="desc-box"><?php echo ale_truncate(get_the_excerpt(), 95); ?> </div> </div> <div class="time-box"><?php echo get_the_date(); ?> </div> <div class="point"> <div class="but"></div> </div> </div> <?php } } wp_reset_query();
/** * 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 } }