• 1.
    function my_theme_navigation() 
  • 2.
    { 
  • 3.
        if ( empty( $GLOBALS['paged'] ) or 2 > $GLOBALS['paged'] )
  • 4.
            return;
  • 5.
        global $shortname;
  • 6.
     
  • 7.
        if( get_option( $shortname . '_next_prev_or_paginate' ) == 'Next' ) : 
  • 8.
            // the block for next-prev navigation 
  • 9.
            previous_posts_link ('Newer');
  • 10.
            next_posts_link('Older');
  • 11.
        else : 
  • 12.
            // the block for pagination
  • 13.
            global $wp_query; 
  • 14.
            $big = 999999999; // need an unlikely integer       
  • 15.
            echo paginate_links( 
  • 16.
                array( 
  • 17.
                    'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ), 
  • 18.
                    'format' => '?paged=%#%', 
  • 19.
                    'current' => max( 1, get_query_var('paged') ), 
  • 20.
                    'total' => $wp_query->max_num_pages 
  • 21.
                ) 
  • 22.
            ); 
  • 23.
        endif; 
  • 24.
    }
function my_theme_navigation() { if ( empty( $GLOBALS['paged'] ) or 2 > $GLOBALS['paged'] ) return; global $shortname; if( get_option( $shortname . '_next_prev_or_paginate' ) == 'Next' ) : // the block for next-prev navigation previous_posts_link ('Newer'); next_posts_link('Older'); else : // the block for pagination global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages ) ); endif; }

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter