Add numbered page navigation without plugin

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #5700
    Ali.Dbg
    Guest

    Add this code to “wp-content/themes/frontier/function.php”

    if(!function_exists('wp_pagenavi')){
    function wp_pagenavi() {	
    		global $wp_query;
    		$big = 999999999; // need an unlikely integer
    		echo paginate_links( array(
    			'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    			'format' => '?paged=%#%',
    			'current' => max( 1, get_query_var('paged') ),
    			'total' => $wp_query->max_num_pages	) );
    		}
    }

    Add CSS to Custom CSS

    .blog-nav {
    	float: left;
    	clear: both;
    	width: 100%;
    	height: 40px;
    	margin-top: 20px;
    }
    
    .blog-nav a.page-numbers {
        border: solid 1px #ccc;
    	-webkit-border-radius: 3px;
    	-moz-border-radius: 3px;
    	border-radius: 3px;
    	-webkit-transition: all 0.4s ease;
      	-moz-transition:    all 0.4s ease;
      	-ms-transition:     all 0.4s ease;
      	-o-transition:      all 0.4s ease;
    	padding: 6px 10px; 
    	margin-right: 5px;
    	text-decoration: none;
    	color: #403f41;
    	font-size: 12px;
    	text-transform: uppercase;
    }
    
    .blog-nav a.page-numbers:hover,
    .blog-nav span.current {
        border: solid 1px #ccc;
    	background: #eaeaea;
    	-webkit-border-radius: 3px;
    	-moz-border-radius: 3px;
    	border-radius: 3px;
    	padding: 6px 10px; 
    	margin-right: 5px;
    	color: #403f41;
    	font-size: 12px;
    	text-transform: uppercase;
    }
Viewing 1 post (of 1 total)
  • The forum ‘WordPress Themes’ is closed to new topics and replies.