function ktz_share_single() { global $wp_query, $post; $blogname = urlencode(get_bloginfo('name') . ' ' . get_bloginfo('description')); $post = $wp_query->post; $excerpt = urlencode(strip_tags(strip_shortcodes(get_the_excerpt()))); if ($excerpt == '') { $excerpt = urlencode(substr(strip_tags(strip_shortcodes(get_the_excerpt())), 0, 250)); } $excerpt = str_replace('+', '%20', $excerpt); $excerpt = str_replace('%0D%0A', '', $excerpt); $permalink = get_permalink($post->ID); $title = str_replace('+', '%20', urlencode($post->post_title)); $thumb = get_post_thumbnail_id(); $img_url = wp_get_attachment_url($thumb, 'full'); if ($img_url) { $img_featured = $img_url; } elseif (get_first_image_src()) { $img_featured = get_first_image_src(); } else { $img_featured = get_template_directory_uri() . '/includes/assets/img/no-image/image-blank.jpg'; } echo '<ul class="nav nav-pills ktz-pills">'; echo previous_post_link('<li class="ktz-prevnext">%link</li>', __('«', 'Previous post link', ktz_theme_textdomain)); if (ot_get_option('ktz_active_shared') != 'no') { echo '<li><a href="//www.facebook.com/sharer/sharer.php?u=' . $permalink . '&t=' . $title . '" target="_blank" class="ktz-facebook" title="Share This On facebook"><span class="fontawesome ktzfo-facebook"></span> Facebook</a></li>'; echo '<li><a href="//twitter.com/home?status=' . $title . '%20-%20' . $permalink . '" target="_blank" class="ktz-twitter" title="Share This On twitter"><span class="fontawesome ktzfo-twitter"></span> Twitter</a></li>'; echo '<li><a href="//pinterest.com/pin/create/button/?url=' . $permalink . '&media=' . $img_featured . '&description=' . $excerpt . '" class="ktz-pinterest" target="_blank" title="Share This On pinterest"><span class="fontawesome ktzfo-pinterest"></span> Pin it</a></li>'; echo '<li class="dropdown">'; echo '<a href="#" class="dropdown-toggle ktz-dropdown js-activated" data-toggle="dropdown">'; echo '...'; echo '</a>'; echo '<ul role="menu" class="dropdown-menu">'; echo '<li><a href="//plus.google.com/share?url=' . $permalink . '" class="ktz-gplus" target="_blank" title="Share This On google plus">Google Plus</a></li>'; echo '<li><a href="//www.digg.com/submit?url=' . $permalink . '" class="ktz-digg" target="_blank" title="Share This On Digg">Digg</a></li>'; echo '<li><a href="//reddit.com/submit?url=' . $permalink . '&title=' . $title . '" class="ktz-reddit" target="_blank" title="Share This On Reddit">Reddit</a></li>'; echo '<li><a href="//www.linkedin.com/shareArticle?mini=true&url=' . $permalink . '" class="ktz-linkedin" target="_blank" title="Share This On Linkedin">Linkedin</a></li>'; echo '<li><a href="//www.stumbleupon.com/submit?url=' . $permalink . '&title=' . $title . '" class="ktz-stumbleupon" target="_blank" title="Share This On Stumbleupon">Stumbleupon</a></li>'; echo '<li><a href="//delicious.com/post?url=' . $permalink . '&title=' . $title . '&notes=' . $excerpt . '" target="_blank" class="ktz-delicious" title="Share This On delicious">Delicious</a></li>'; echo '<li><a href="mailto:?Subject=' . $title . '&Body=I%20saw%20this%20and%20thought%20of%20you!%20 ' . $permalink . '" class="ktz-email" target="_blank" title="Email friend">Email friend</a></li>'; echo '</ul>'; echo '</li>'; } echo next_post_link('<li class="ktz-prevnext">%link</li>', __('»', 'Next post link', ktz_theme_textdomain)); echo '</ul>'; }
/** * KENTOOZ DEFAULD POST TEMPLATE **/ ?> <article id="post-<?php the_ID(); ?> " <?php post_class('box-post ktz-archive'); ?> > <div class="entry-body media ktz-miniblog"> <?php $thumb = get_post_thumbnail_id(); $img_url = wp_get_attachment_url($thumb, 'full'); $fisrtimg_url = get_first_image_src(); $get_imgpost_upload = ktz_getpost_images_upload(); if ($img_url || $fisrtimg_url || $get_imgpost_upload) { echo '<div class="ktz-thumbwrap">'; echo ktz_featured_img(60, 60); // New kentooz image croping just call ktz_featured_img( width, height ) echo '<span class="fontawesome ktzfo-caret-right"></span>'; echo '</div>'; } ?> <div class="media-body ktz-post"> <?php ktz_posted_title_h('h2', 'entry-title ktz-titlemini'); ?> <div style="display:none;">
function ktz_relpost() { if (ot_get_option('ktz_active_related') == 'yes') { global $post; $orig_post = $post; $opsi_numberrelated = ot_get_option('ktz_numberpost_related'); $numberpost = !empty($opsi_numberrelated) ? $opsi_numberrelated : '4'; if (ot_get_option('ktz_taxonomy_relpost') == 'tags') { $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_ids = array(); foreach ($tags as $individual_tag) { $tag_ids[] = $individual_tag->term_id; } $args = array('tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'posts_per_page' => $numberpost, 'ignore_sticky_posts' => 1); } } else { $categories = get_the_category($post->ID); if ($categories) { $category_ids = array(); foreach ($categories as $individual_category) { $category_ids[] = $individual_category->term_id; } $args = array('category__in' => $category_ids, 'post__not_in' => array($post->ID), 'posts_per_page' => $numberpost, 'ignore_sticky_posts' => 1); } } if (!isset($args)) { $args = ''; } $ktz_query = new WP_Query($args); $i = 1; if ($ktz_query->have_posts()) { echo '<h2 class="related-title"><span>' . __('Related Post', ktz_theme_textdomain) . ' "' . get_the_title() . '"</span></h2>'; echo '<div class="ktz-related-post row">'; while ($ktz_query->have_posts()) { $ktz_query->the_post(); global $post; $thumb = get_post_thumbnail_id(); $img_url = wp_get_attachment_url($thumb, 'full'); $fisrtimg_url = get_first_image_src(); $get_imgpost_upload = ktz_getpost_images_upload(); if ($i % 2 == 0) { echo '<div class="col-md-6">'; echo '<div class="entry-body media ktz-miniblog">'; if ($img_url || $fisrtimg_url || $get_imgpost_upload) { echo '<div class="ktz-thumbwrap">'; echo ktz_featured_img(60, 60); // New kentooz image croping just call ktz_featured_img( width, height ) echo '<span class="fontawesome ktzfo-caret-right"></span>'; echo '</div>'; } echo '<div class="media-body ktz-post">'; ktz_posted_title_a(); echo '<div>'; echo ktz_get_excerpt(8); echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; echo '<div class="clearfix"></div>'; } else { echo '<div class="col-md-6">'; echo '<div class="entry-body media ktz-miniblog">'; $thumb = get_post_thumbnail_id(); $img_url = wp_get_attachment_url($thumb, 'full'); $fisrtimg_url = get_first_image_src(); if ($img_url || $fisrtimg_url) { echo '<div class="ktz-thumbwrap">'; echo ktz_featured_img(60, 60); // New kentooz image croping just call ktz_featured_img( width, height ) echo '<span class="fontawesome ktzfo-caret-right"></span>'; echo '</div>'; } echo '<div class="media-body ktz-post">'; ktz_posted_title_a(); echo '<div>'; echo ktz_get_excerpt(8); echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; } $i++; } echo '</div>'; } else { echo '<div class="no-post">No related post!</div>'; } $post = $orig_post; wp_reset_query(); } }
function ktz_get_dl_image() { global $post; $title = get_the_title(); $thumb = get_post_thumbnail_id(); $img_url = wp_get_attachment_url($thumb, 'full'); $fisrtimg_url = get_first_image_src(); if ($img_url) { echo '<a href="' . $img_url . '" class="btn btn-block btn-default ktz-downloadbtn" target="_blank" title="' . $title . '">Download Full Image</a>'; } elseif ($fisrtimg_url) { echo '<a href="' . $fisrtimg_url . '" class="btn btn-block btn-default ktz-downloadbtn" target="_blank" title="' . $title . '">Download Full Image</a>'; } else { echo ''; } }