How to get my loop to paginate?

In functions.php

function my_theme_navigation() 
{ 
    global $shortname;

    if( get_option( $shortname . '_next_prev_or_paginate' ) == 'Next' ) : 
        // the block for next-prev navigation
        echo '<div style="float:left">';
        next_posts_link('Older');
        echo '</div>';
        echo '<div style="float:right">';
        previous_posts_link ('Newer');
        echo '</div>';
    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=%#%',
        'end_size'     => 1,
        'mid_size'     => 2,
                'current' => max( 1, get_query_var('paged') ), 
                'total' => $wp_query->max_num_pages
            )
        ); 
    endif; 
}

Then replace

<!-- Older/Newer Pagination -->
<?php if ($wp_query->max_num_pages > 1) : ?>
    <?php next_posts_link( __( '<span class="arrow">&larr;</span> Older' ) ); ?>
    <?php previous_posts_link( __( 'Newer <span class="arrow">&rarr;</span>' ) ); ?>
<?php endif; ?>
<!-- /Older/Newer Pagination -->

<?php
/* PageNavi at Bottom */
    if (function_exists('wp_pagenavi')){wp_pagenavi();}
    $wp_query = null;
    $wp_query = $temp;
    wp_reset_query();
?>

WITH…

<?php my_theme_navigation(); ?>