'; echo get_the_date( get_option('date_format') ); echo ''; endif; } else { echo ' '; echo get_the_date( get_option('date_format') ); echo ''; } } endif; /* author */ if (!function_exists('tx_author')) : add_action('tx_author', 'tx_author'); function tx_author() { if ( class_exists( 'ReduxFramework' ) ) { global $tx; if ($tx['post-author']) : echo ''; echo ' '; echo '' . esc_html( get_the_author() ) . ''; echo ''; endif; } else { echo ''; echo ' '; echo '' . esc_html( get_the_author() ) . ''; echo ''; } } endif; /* comments */ if (!function_exists('tx_comments')) : add_action('tx_comments', 'tx_comments'); function tx_comments() { global $tx; if ( class_exists( 'ReduxFramework' ) ) { if ($tx['post-comment']) : if ( 'post' == get_post_type() ) { echo ' '; if ( ! comments_open() && get_comments_number() < 1 ) : comments_number( esc_html__( 'No Comments', 'avas' ), esc_html__( '1 Comment', 'avas' ), esc_html__( '% Comments', 'avas' ) ); else : echo ''; comments_number( esc_html__( 'No Comment', 'avas' ), esc_html__( '1 Comment', 'avas' ), esc_html__( '% Comments', 'avas' ) ); echo ''; endif; echo ''; } endif; } else { if ( 'post' == get_post_type() ) { echo ' '; if ( ! comments_open() && get_comments_number() < 1 ) : comments_number( esc_html__( 'No Comments', 'avas' ), esc_html__( '1 Comment', 'avas' ), esc_html__( '% Comments', 'avas' ) ); else : echo ''; comments_number( esc_html__( 'Leave a Comment', 'avas' ), esc_html__( '1 Comment', 'avas' ), esc_html__( '% Comments', 'avas' ) ); echo ''; endif; echo ''; } } } endif; /* category */ if (!function_exists('tx_category')) : add_action('tx_category', 'tx_category'); function tx_category() { if ( class_exists( 'ReduxFramework' ) ) { global $tx; if ($tx['post-category']) : if (has_category()) { echo ' ' ; echo ''; echo the_category(', '); echo ''; } endif; } else { if (has_category()) { echo ' ' ; echo ''; echo the_category(', '); echo ''; } } } endif; /* tags */ if (!function_exists('tx_tags')) : add_action('tx_tags', 'tx_tags'); function tx_tags() { if ( class_exists( 'ReduxFramework' ) ) { global $tx; if ($tx['post-tag']) : if (has_tag( )) { echo ' '; echo ''; echo the_tags('', ', ', '
'); echo '
'; } endif; } else { if (has_tag( )) { echo ' '; echo ''; echo the_tags('', ', ', '
'); echo '
'; } } } endif; /* --------------------------------------------------------- Post View ------------------------------------------------------------ */ if ( ! function_exists('tx_getPostViews')) { // function to display number of posts. function tx_getPostViews($postID){ global $tx; // if ($tx['post-views']) : $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); return ' 0 ' . esc_html__('View', 'avas') . ''; } return ' '.$count.' ' . esc_html__('Views', 'avas') . ''; // endif; } } if ( ! function_exists('tx_setPostViews')) { // function to count views. function tx_setPostViews($postID) { $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); }else{ $count++; update_post_meta($postID, $count_key, $count); } } } /* --------------------------------------------------------- EOF ------------------------------------------------------------ */