max_num_pages < 2 ) {
return;
}
global $wp_query;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
?>
max_num_pages ); ?>
← Older Posts', 'redxunlite' ) ); ?>
→', 'redxunlite' ) ); ?>
post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) {
return;
}
global $wp_query;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
?>
%link
', _x( ' ← Previous', 'Previous post link', 'redxunlite' ) ); ?>
%link', _x( 'Next →', 'Next post link', 'redxunlite' ) ); ?>
%2$s';
$time_string = sprintf( $time_string,
get_the_date( DATE_W3C ),
get_the_date(),
get_the_modified_date( DATE_W3C ),
get_the_modified_date()
);
printf( __( '%1$s %2$s', 'redxunlite' ),
sprintf( '%2$s',
esc_url( get_permalink() ),
$time_string
),
sprintf( '%2$s',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
)
);
}
endif;
//-----------------------------------------------------
// Returns true if a blog has more than 1 category.
//-----------------------------------------------------
function redxunlite_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'all_the_cool_cats' ) ) ) {
$all_the_cool_cats = get_categories( array(
'hide_empty' => 1,
) );
// Count the number of categories that are attached to the posts.
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'all_the_cool_cats', $all_the_cool_cats );
}
if ( '1' != $all_the_cool_cats ) {
return true;
} else {
return false;
}
}
//-----------------------------------------------------
// Tags in post
//-----------------------------------------------------
if ( ! function_exists( 'redxunlite_wtn_post_tags' ) ) :
function redxunlite_wtn_post_tags() {
/* translators: used between list items, there is a space after the comma */
$separate_meta = __( ' ', 'redxunlite' );
if ( 'post' === get_post_type() ) {
$tags_list = get_the_tag_list( '', $separate_meta );
if ( $tags_list ) {
echo '' . $tags_list . '
'; // WPCS: XSS OK.
}
}
}
endif;
//-----------------------------------------------------
// Category widget style, add span in nr
//-----------------------------------------------------
add_filter('wp_list_categories', 'redxunlite_add_span_cat_count');
function redxunlite_add_span_cat_count($links) {
$links = str_replace(' (', ' (', $links);
$links = str_replace(')', ')', $links);
return $links;
}
//-----------------------------------------------------
// Get Author Name Linked
//-----------------------------------------------------
function redxunlite_wtn_author_info_name() {
global $post;
$a_user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));
$a_display_name = get_the_author_meta( 'display_name', $post->post_author );
if ( empty( $display_name ) )
$a_display_name = get_the_author_meta( 'nickname', $post->post_author );
echo '' . $a_display_name . '';
}
//-----------------------------------------------------
// Get Author Gravatar
//-----------------------------------------------------
function redxunlite_wtn_author_gravatar() {
global $post;
echo get_avatar( get_the_author_meta('user_email' , $post->post_author) , 54 );
}
//-----------------------------------------------------
// Author Box
//-----------------------------------------------------
function redxunlite_wtn_author_info_box() {
global $post;
$display_name = get_the_author_meta( 'display_name', $post->post_author );
if ( empty( $display_name ) )
$display_name = get_the_author_meta( 'nickname', $post->post_author );
$user_description = get_the_author_meta( 'user_description', $post->post_author );
$user_website = get_the_author_meta('url', $post->post_author);
$user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));
if ( ! empty( $display_name ) )
$author_details = 'By ' . $display_name . '
';
if ( ! empty( $user_description ) )
$author_details .= '' . get_avatar( get_the_author_meta('user_email') , 60 ) . nl2br( $user_description ). '
';
$author_details .= '';
} else {
$author_details .= '';
}
// Pass all this info to post content
$content ='';
$content = $content . '';
return $content;
}
//-----------------------------------------------------
// Page Excerpts
//-----------------------------------------------------
add_action( 'init', 'redxunlite_wtn_add_excerpts_to_pages' );
function redxunlite_wtn_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
//-----------------------------------------------------
// Flush out the transients used in _categorized_blog.
//-----------------------------------------------------
function redxunlite_category_transient_flusher() {
delete_transient( 'all_the_cool_cats' );
}
add_action( 'edit_category', 'redxunlite_category_transient_flusher' );
add_action( 'save_post', 'redxunlite_category_transient_flusher' );