query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;
$pagination = array(
'base' => @add_query_arg('paged','%#%'),
'format' => '?page=%#%',
'total' => $wp_query->max_num_pages,
'current' => $current,
'show_all' => false,
'end_size' => 1,
'mid_size' => 2,
'prev_next' => true,
'prev_text' => __(' Prev', 'alchem'),
'next_text' => __('Next ', 'alchem'),
'type' => 'list',
'add_args' => false,
'add_fragment' => '',
'before_page_number' => '',
'after_page_number' => ''
);
if( $wp_rewrite->using_permalinks() )
$pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged');
if( !empty($wp_query->query_vars['s']) )
$pagination['add_args'] = array('s'=>get_query_var('s'));
if( $wp_query->max_num_pages > 1 ){
if($echo == "echo"){
echo '';
}else
{
return '';
}
}
}
endif;
if ( ! function_exists( 'alchem_post_nav' ) ) :
/**
* Display navigation to next/previous post when applicable.
*/
function alchem_post_nav() {
// Don't print empty markup if there's nowhere to navigate.
$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) {
return;
}
?>
';
if( $display_meta_date == 'yes' )
$return .= '
'. get_the_date( $date_format ).'';
if( $display_meta_author == 'yes' )
$return .= ''.get_the_author_link().'';
if( $display_meta_categories == 'yes' )
$return .= ''.get_the_category_list(', ').'';
if( $display_meta_comments == 'yes' )
$return .= '';
$return .= '';
}
if( $echo == true )
echo $return;
else
return $return;
}
endif;
/**
* Returns true if a blog has more than 1 category.
*
* @return bool
*/
function alchem_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'alchem_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( 'alchem_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
// This blog has more than 1 category so alchem_categorized_blog should return true.
return true;
} else {
// This blog has only 1 category so alchem_categorized_blog should return false.
return false;
}
}
/**
* Flush out the transients used in alchem_categorized_blog.
*/
function alchem_category_transient_flusher() {
// Like, beat it. Dig?
delete_transient( 'alchem_categories' );
}
add_action( 'edit_category', 'alchem_category_transient_flusher' );
add_action( 'save_post', 'alchem_category_transient_flusher' );
// Custom comments list
function alchem_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
$date_format = alchem_option('date_format','M d, Y');
?>
id="comment-">
comment_approved == '0') : ?>