max_num_pages < 2 ) { return; } ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> '; $entry_meta = sprintf($entry_meta, esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( $viewbyauthor_text, get_the_author() ) ), esc_html( get_the_author() )); print $entry_meta; if(comments_open()){ printf(' %1$s ',_x( 'Comments', 'Used before post author name.', 'nisarg' )); comments_popup_link( __('0 Comment','nisarg'), __('1 comment','nisarg'), __('% comments','nisarg'), 'comments-link', ''); } } endif; if ( ! function_exists( 'nisarg_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function nisarg_entry_footer() { if(is_single()) echo '
'; if(!is_home() && !is_search() && !is_archive()){ if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'nisarg' ) ); echo '
'; if ( $categories_list && nisarg_categorized_blog() ) { printf( '
' . esc_html__( '%1$s', 'nisarg' ) . '
', $categories_list ); // WPCS: XSS OK. } else{ echo '
'; } $tags_list = get_the_tag_list( '', esc_html__( ', ', 'nisarg' ) ); if ( $tags_list ) { printf( '
' . esc_html__( ' %1$s', 'nisarg' ) . '
', $tags_list ); // WPCS: XSS OK. } echo '
'; } } edit_post_link( esc_html__( 'Edit This Post', 'nisarg' ), '
', '' ); } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function nisarg_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'nisarg_categories' ) ) ) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'nisarg_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so nisarg_categorized_blog should return true. return true; } else { // This blog has only 1 category so nisarg_categorized_blog should return false. return false; } } /** * Display featured image of the post */ function nisarg_featured_image_disaplay() { if ( has_post_thumbnail() && ! post_password_required() && ! is_attachment() ) { // check if the post has a Post Thumbnail assigned to it. ?>