Support » Plugin: WP-PageNavi » can't make it work with gavick rockwall theme

  • Hello.

    I tried to replace the functions in my actual theme code but it doesn’t work. It stills displaying the Oldest Post link instead of pagination plugin numbers.

    I’m using a gavick wordpress theme called rockwall and the functions are in the Rockwall/gavern/helpers/helpers.layout.fragments.php file (around line 300)

    The original code is this:

    /**
     *
     * Function to generate the post pagination
     *
     * @return null
     *
     **/
    function gk_post_links() {
    	global $tpl;
    
    	wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', GKTPLNAME ) . '</span>', 'after' => '</div>' ) );
    }
    
    /**
     *
     * Function to generate the post navigation
     *
     * @param id - id of the NAV element
     *
     * @return null
     *
     **/
    function gk_content_nav($id = '') {
    	global $tpl;
    	global $wp_query;
    
    	if($wp_query->max_num_pages > 1) : ?>
    		<?php do_action('gavernwp_before_nav'); ?>
    		<nav class="pagenav"<?php if($id != '') : ?> id="<?php echo $id; ?>"<?php endif; ?>>
    			<?php if(get_next_posts_link() != '') : ?>
    			<div class="nav-prev nav-btn"><?php next_posts_link( __( 'Older posts', GKTPLNAME ) ); ?></div>
    			<?php endif; ?>
    
    			<?php if(get_previous_posts_link() != '') : ?>
    			<div class="nav-next nav-btn"><?php previous_posts_link( __( 'Newer posts', GKTPLNAME ) ); ?></div>
    			<?php endif; ?>
    		</nav><!-- #nav-above -->
    		<?php do_action('gavernwp_after_nav'); ?>
    	<?php endif;
    }

    So i need to replace:

    1.

    <div class="nav-prev nav-btn"><?php next_posts_link( __( 'Older posts', GKTPLNAME ) ); ?></div> with <?php wp_pagenavi(); ?>

    2.
    <div class="nav-next nav-btn"><?php previous_posts_link( __( 'Newer posts', GKTPLNAME ) ); ?></div> with <?php wp_pagenavi(); ?>

    Anything else? And is this ok?

    And about this one <?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?> where should i replace it?

    Thanks,
    Miguel.

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    http://wordpress.org/plugins/wp-pagenavi/

  • The topic ‘can't make it work with gavick rockwall theme’ is closed to new replies.