(',')'), array('',''), $links); } } add_filter('wp_list_categories', 'activeblog_cat_count'); if(!function_exists('activeblog_archive_count')){ function activeblog_archive_count($links) { return str_replace(array(' (',')'), array('',''), $links); } } add_filter('get_archives_link', 'activeblog_archive_count'); /*-----------------------------------------------------------------------------------*/ /* Modify Tag in Posts /*-----------------------------------------------------------------------------------*/ // Prevent Page Scroll When Clicking the More Link function activeblog_remove_more_link_scroll( $link ) { $link = preg_replace( '|#more-[0-9]+|', '', $link ); return $link; } add_filter( 'the_content_more_link', 'activeblog_remove_more_link_scroll' ); /*-----------------------------------------------------------------------------------*/ /* Pagination /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'activeblog_paging_nav' ) ) : /** * Display navigation to next/previous set of posts when applicable. * */ function activeblog_paging_nav() { // Don't print empty markup if there's only one page. if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { return; } $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?', $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1], $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; // Set up paginated links. $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map( 'urlencode', $query_args ), 'prev_text' => __( '← Previous', 'activeblog' ), 'next_text' => __( 'Next →', 'activeblog' ), ) ); if (get_theme_mod('pagination_type', 'num' ) == 'num') : if ( $links ) : ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?>