• Hi there! I love your theme but there is one major flaw, namely its lack of a properly styled pagination nav menu. For such an expansive and great looking theme, it is a shame. Anyway I was trying to solve this but I cannot find the next_posts_link() and previous_posts_link() functions in the loop.php file. Can you tell me where they are please?

    Oh, I’m sure that if you include some pagination options with future updates everyone using this theme is going to thank you for it. Something just as simple as applying the button style to the pagination nav menu would suffice.

    Anyway thanks for this great theme

Viewing 4 replies - 1 through 4 (of 4 total)
  • next_posts_link() and previous_posts_link() are in /includes/theme-loop.php. You don’t have to hack parent theme to change it. The function is wrapped in if (!function_exists( 'graphene_posts_nav' ) ). So, just create a function in your child theme called graphene_posts_nav() and make it your own.

    The theme natively supports WP-PageNavi plugin. Just install it and you have a flawless pagination system!

    If you want to style single posts navigation, you can target .previous and .next-post CSS classes. I’ve done it in my site. See here – https://www.prasannasp.net/fixed-position-graphene-theme-header-menu/

    Thread Starter The Magpie

    (@the-magpie)

    Thanks for your reply. PageNavi works, but what I am looking for is a way to change pagination style for multiple page posts. PageNavi only adds a decent looking navigation bar for the home page. It does nothing for posts. So I am trying to use Simple pagination instead. In the installation directions the plugin states that:

    Usage for posts
    In your theme, open the theme files where you’d like pagination to be used. You need to find calls to next_posts_link() and previous_posts_link() and replace them.

    Usually this is the loop.php file.

    You would replace those two lines with this:

    <?php if(function_exists(‘wp_simple_pagination’)) {
    wp_simple_pagination();
    } ?>

    I am obviously no PHP wizard so my question is where do I need to replace these functions to allow for post pagination?

    The plugin author also states that ” Display pagination in the loop of posts <?php wp_simple_pagination(); ?>”

    What do I do, and where do I do it?

    Thanks!

    No need to edit parent theme files. Add this to child-theme‘s functions.php file anywhere between <?php and ?>

    function graphene_posts_nav(){
                    if (function_exists( 'wp_pagenavi' ) ) :  ?>
                            <div class="post-nav clearfix">
                                    <?php wp_pagenavi(); ?>
                            </div>
                <div class="post-nav clearfix">
                        <p class="wp-simple-pagination"><?php if(function_exists('wp_simple_pagination')) {
        wp_simple_pagination();
    } ?></p>
                </div>
    
            <?php
                    endif;
            }
    Thread Starter The Magpie

    (@the-magpie)

    Thanks for your reply! Unfortunately it did not work. I added a functions.php file to my child theme and added the code. This is how the entire file looks

    <?php
    function graphene_posts_nav(){
                    if (function_exists( 'wp_pagenavi' ) ) :  ?>
                            <div class="post-nav clearfix">
                                    <?php wp_pagenavi(); ?>
                            </div>
                <div class="post-nav clearfix">
                        <p class="wp-simple-pagination"><?php if(function_exists('wp_simple_pagination')) {
        wp_simple_pagination();
    } ?></p>
                </div>
    
            <?php
                    endif;
            }
    ?>

    Unfortunately there is no change. The post are still not paginated with pagenavi.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Pagination Style Problem’ is closed to new replies.