• Resolved fpandjic

    (@fpandjic)


    Hi everyone.

    I’m having small problems with pagination. Everything works fine on the main page, where PageNavi pagination works. But if I use a pagebreak in my posts (<!–nextpage–>), it looks like PageNavi style isn’t loaded.

    The same style in posts is used on the main page when I disable PageNavi

    Working paginationn
    Posts pagination

    Does anyone else have similar problem?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter fpandjic

    (@fpandjic)

    Anyone?

    Hi fpandjic. The plugin Installation instructions discuss replacing the default php calls with the related pagenavi code. Did you have any problems installing the pagenavi code?

    Thread Starter fpandjic

    (@fpandjic)

    None. Everything worked perfect from the beginning. But I didn’t know that post pagination isn’t working as until now, I didn’t have any multiple page article..

    Thread Starter fpandjic

    (@fpandjic)

    I also know about that part, but in pagination.php file there is already code for that

    <nav class="pagination group">
    	<?php if ( function_exists('wp_pagenavi') ): ?>
    		<?php wp_pagenavi(); ?>
    
    	<?php else: ?>
    		<ul class="group">
    		<li class="prev left"><?php previous_posts_link(); ?></li>
    		<li class="next right"><?php next_posts_link(); ?></li>
    		</ul>
    	<?php endif; ?>
    </nav><!--/.pagination-->

    Could you post a link to your site so we can see the issue?

    Yes, the theme has built-in support for PageNavi on the default posts page. If you want to use PageNavi on a multi-page single post then you need to edit single.php and change line 24 from this:

    <?php wp_link_pages(array(‘before’=>'<div class=”post-pages”>’.__(‘Pages:’,’hueman’),’after’=>'</div>’)); ?>

    to this:

    <?php wp_pagenavi( array( ‘type’ => ‘multipart’ ) ); ?>

    Correction: it’s line 23 in single.php. Actually, a better solution would be to replace line 23 with the following code block:

    <?php if ( function_exists('wp_pagenavi') ): ?>
       <?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?>
    <?php else: ?>
       <?php wp_link_pages(array('before'=>'<div class="post-pages">'.__('Pages:','hueman'),'after'=>'</div>')); ?>
    <?php endif; ?>

    That way the default theme pagination will still work if you decide not to use PageNavi.

    Thread Starter fpandjic

    (@fpandjic)

    It works now, but partially. It shows both pagination

    I replaced this part with your code:
    <?php if ( ot_get_option('sharrre') != 'off' ) { get_template_part('inc/sharrre'); } ?>

    This is how the part of code looks in single.php

    <div class="entry <?php if ( ot_get_option('sharrre') != 'off' ) { echo 'share'; }; ?>">
    						<div class="entry-inner">
    							<?php the_content(); ?>
    							<?php wp_link_pages(array('before'=>'<div class="post-pages">'.__('Pages:','hueman'),'after'=>'</div>')); ?>
    						</div>
    						<?php if ( function_exists('wp_pagenavi') ): ?>
    							<?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?>
    						<?php else: ?>
    							<?php wp_link_pages(array('before'=>'<div class="post-pages">'.__('Pages:','hueman'),'after'=>'</div>')); ?>
    						<?php endif; ?>
    						<div class="clear"></div>
    					</div><!--/.entry-->

    If you’re using the theme from www.remarpro.com maybe the line numbers are different. In any case, take out the code block you put in, put the line you removed back where it was, then go up two lines to this line:

    <?php wp_link_pages(array('before'=>'<div class="post-pages">'.__('Pages:','hueman'),'after'=>'</div>')); ?>

    and replace that line with the block of code I posted above. Let me know if that works.

    Thread Starter fpandjic

    (@fpandjic)

    Yes, it is working now! Thank you!

    p.s. I’m using Hueman 2.1.9 version and that was downloaded directly from alxmedia’s website

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Post pagination not working’ is closed to new replies.