$category ): if ($index > 0) : $categories_output .= $separator; endif; $categories_output .= '' . esc_html( $category->name ) . ''; endforeach; endif; if ( 'post' == get_post_type() ) : $output .= '
'; endif; if ( $echo ) { echo html_entity_decode( esc_html( $output ) ); } else { return $output; } } } if ( ! function_exists( 'blockst_meta_date' ) ) { /** * Prints HTML with meta information for the current post-date/time. * * @param bool $default Returns default format if true. */ function blockst_meta_date() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ) ); echo ''; } } if ( ! function_exists( 'blockst_meta_author' ) ) { /** * Prints HTML with meta information for the current author. */ function blockst_meta_author() { ?> 1 ) { $comments = $comments_num . esc_html__(' Comments', 'blockst'); } else { $comments = esc_html__('1 Comment', 'blockst'); } $comments = sprintf('%2$s', get_comments_link(), $comments ); } else { $comments = esc_html__('Comments are closed', 'blockst'); } $output .= ''; echo html_entity_decode( esc_html( $output ) ); } } if ( ! function_exists( 'blockst_related_posts' ) ) { /** * Related Posts */ function blockst_related_posts() { global $post; $post_id = $post->ID; $tags = wp_get_post_tags( $post->ID ); $author_id = get_the_author_meta( 'ID' ); $related_by = get_theme_mod( 'blockst_settings_related_posts_relation', 'category' ); $exclude_ids = array( $post_id ); $posts_per_page = 4; $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'update_post_meta_cache' => false, 'posts_per_page' => absint( $posts_per_page ), 'ignore_sticky_posts' => true, 'fields' => 'ids', ); if ( $tags && 'tag' === $related_by ) { $tag_ids = array(); foreach ( $tags as $tag ) { $tag_ids[] = $tag->term_id; } $args['tag__in'] = $tag_ids; } elseif ( 'category' === $related_by ) { $args['category__in'] = wp_get_post_categories( $post_id ); } elseif ( 'author' === $related_by ) { $args['author'] = $author_id; } $query = new WP_Query( $args ); if ( $query->found_posts <= 1 ) { return; } ?> have_posts() ) : ?> '', 'link_before' => '', 'link_after' => '', 'next_or_number' => 'number', 'separator' => ' ', 'nextpagelink' => esc_html( 'Next page', 'blockst' ), 'previouspagelink' => esc_html( 'Previous page', 'blockst' ), 'pagelink' => '%', 'echo' => 1 ); wp_link_pages( $defaults ); } } if ( ! function_exists( 'blockst_post_pagination' ) ) { /** * Post pagination * * @since 1.0.0 */ function blockst_post_pagination() { // Don't print empty markup if there's only one page. if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { return; } ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); $get_next_post = get_next_post(); $get_previous_post = get_previous_post(); if ( ! $next && ! $previous ) { return; } ?> get_the_author_meta( 'facebook' ), 'twitter' => get_the_author_meta( 'twitter' ), 'linkedin' => get_the_author_meta( 'linkedin' ), 'instagram' => get_the_author_meta( 'instagram' ), 'youtube' => get_the_author_meta( 'youtube' ), 'vimeo' => get_the_author_meta( 'vimeo' ), 'github' => get_the_author_meta( 'github' ) ); $website = rtrim( get_the_author_meta( 'url' ), '/' ); ?> ' ) { $description = apply_filters( 'get_the_archive_description', wp_strip_all_tags( term_description() ) ); if ( ! empty( $description ) ) { echo html_entity_decode( esc_html( $before . $description . $after ) ); } } }