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),
'showposts'=>3, // Number of related posts that will be shown.
);
$my_query = new WP_Query( $args );
if( $my_query->have_posts() ) {
echo '
';
if (isset($secretlab['related_posts_title'])) {
$sl_related_title = $secretlab['related_posts_title'];
if ($sl_related_title != '') {
echo '
' . $sl_related_title . '
';
}
}
while ($my_query->have_posts()) {
$my_query->the_post();
?>
';
}
}
$post = $backup;
wp_reset_postdata();
}
// Date and continue link for post feed
if ( ! function_exists( 'atiframebuilder_entry_date' ) ) {
function atiframebuilder_entry_date()
{
global $post, $secretlab;
$p = $post;
$sl_show_post_date = isset($secretlab['show_post_date']) ? $secretlab['show_post_date'] : 1;
if ($sl_show_post_date == 1) {
echo ' ';
echo '';
echo '';
echo '';
echo '';
echo ' '. get_the_modified_time('F jS, Y h:i a').'';
}
}
}
// Read more link for post feed
if ( ! function_exists( 'atiframebuilder_read_more' ) ) {
function atiframebuilder_read_more()
{
global $post, $secretlab;
$p = $post;
$sl_show_post_date = isset($secretlab['show_read_more']) ? $secretlab['show_read_more'] : 1;
if ($sl_show_post_date == 1) {
$sl_rmt = '';
if (isset($secretlab['read_more_text'])) {
$sl_rmt = $secretlab['read_more_text'];
}
if ($sl_rmt != '') {
echo ''. $sl_rmt.'';
}
}
}
}
/**
* Print HTML with meta information for current post: categories, comments counter, author, and date.
*
* Create your own atiframebuilder_entry_meta() to override in a child theme.
*
*/
if ( ! function_exists( 'atiframebuilder_entry_meta' ) ) {
function atiframebuilder_entry_meta() {
global $secretlab;
// Post author
if (isset($secretlab['show_post_author'])) {
if ($secretlab['show_post_author'] == 1) {
if ('post' == get_post_type()) {
printf('%3$s',
esc_url(get_author_posts_url(get_the_author_meta('ID'))),
esc_attr(sprintf(esc_html__('View all posts by %s', 'atiframe-builder'), get_the_author())),
get_the_author()
);
}
}
} else {
printf('%3$s',
esc_url(get_author_posts_url(get_the_author_meta('ID'))),
esc_attr(sprintf(esc_html__('View all posts by %s', 'atiframe-builder'), get_the_author())),
get_the_author()
);
}
// Categories: used between list items, there is a space after the comma.
$categories_list = get_the_category_list(', ');
if (isset($secretlab['show_post_category'])) {
if ($secretlab['show_post_category'] == 1) {
if ($categories_list) {
echo ' ' . $categories_list . '';
}
}
} else {
echo ' ' . $categories_list . '';
}
//Post data
if (isset($secretlab['show_post_date'])) {
if ($secretlab['show_post_date'] == 1) {
echo ' '. get_the_date().'';
}
} else {
echo ' ' . get_the_date() . '';
}
echo ' '. get_the_modified_time('F jS, Y h:i a').'';
// Comments counter
if (isset($secretlab['show_comments_count'])) {
if ($secretlab['show_comments_count'] == 1) {
if (comments_open(get_the_ID())) {
echo ' ';
comments_popup_link(esc_attr__('Leave a comment', 'atiframe-builder'), esc_attr__('1 Comment', 'atiframe-builder'), esc_html__('% Comments', 'atiframe-builder'));
echo '';
}
}
} else {
echo ' ';
comments_popup_link(esc_attr__('Leave a comment', 'atiframe-builder'), esc_attr__('1 Comment', 'atiframe-builder'), esc_html__('% Comments', 'atiframe-builder'));
echo '';
}
}
}
/**
* Print HTML with meta information for current post: categories, comments counter, author, and date.
*
* Create your own atiframebuilder_entry_meta() to override in a child theme.
*
*/
if ( ! function_exists( 'atiframebuilder_entry_meta_short' ) ) {
function atiframebuilder_entry_meta_short()
{
global $secretlab;
//Post data
if (isset($secretlab['show_post_date'])) {
if ($secretlab['show_post_date'] == 1) {
if (isset($secretlab['blog-sidebar-layout'])) {
$sl_blog_sidebars = $secretlab['blog-sidebar-layout'];
if (!is_single()) {
if ( $sl_blog_sidebars == 1) {
echo '' . get_the_time('M j, Y') . '';
} else {
echo '' . get_the_time('F j, Y') . '';
}
}
}
}
} else {
if (!is_single()) {
echo '' . get_the_time('F j, Y') . '';
}
}
// Comments counter
if (isset($secretlab['show_comments_count'])) {
if ($secretlab['show_comments_count'] == 1) {
if (comments_open(get_the_ID())) {
echo ' ';
if (isset($secretlab['blog-sidebar-layout'])) {
$sl_blog_sidebars = $secretlab['blog-sidebar-layout'];
if (!is_single()) {
if ($sl_blog_columns == 3 and $sl_blog_sidebars == 1) {
echo wp_count_comments(get_the_ID())->approved;
} else {
comments_popup_link(esc_attr__('0 Comments', 'atiframe-builder'), esc_attr__('1 Comment', 'atiframe-builder'), esc_html__('% Comments', 'atiframe-builder'));
}
}
}
echo '';
}
}
} else {
if (!is_single()) {
echo ' ';
comments_number(esc_attr__('0 Comments', 'atiframe-builder'), esc_attr__('1 Comment', 'atiframe-builder'), esc_html__('% Comments', 'atiframe-builder'));
echo '';
}
}
}
}
/**
* Display navigation to next/previous post when applicable.
*
*/
if ( ! function_exists( 'atiframebuilder_post_nav' ) ) {
function atiframebuilder_post_nav()
{
global $post;
// Don't print empty markup if there's nowhere to navigate.
$previous = (is_attachment()) ? get_post($post->post_parent) : get_adjacent_post(false, '', true);
$next = get_adjacent_post(false, '', false);
if (!$next && !$previous)
return;
?>
post_parent) : get_adjacent_post(false, '', true);
$inext = get_adjacent_post(false, '', false);
if (!$inext && !$iprevious)
return;
?>
'; } echo ''; echo '