• Resolved twirth5

    (@twirth5)


    I cannot get PageNavi to work with paginated posts. Instead, I get the generic “Page 1 2 3 4…”

    As suggested by the PageNavi devs, I tried updating the <?php wp_pagenavi(); ?> code with the array option “<?php wp_pagenavi( array( ‘type’ => ‘multipart’ ) ); ?>” in pagination.php to no avail. This was my first attempt at modifying Hueman CSS.

    PageNavi works great otherwise, which in my case are on the home and archive (category) pages.

    I suspect that I have to do something with a child menu but have not found sufficient information in order to be brave enough to make an attempt. Note that thus far I have left the Hueman theme CSS alone and using JetPack Edit CSS to tweak things.

    Can somebody point me in the right direction?

    https://wirthconsulting.org

Viewing 8 replies - 1 through 8 (of 8 total)
  • bdbrown

    (@bdbrown)

    Hi twirth5. As you’ve found, the theme has built-in support for PageNavi. The pagination.php file is loaded on the index (home) and archive pages and will use WP-PageNavi if the plugin is installed and active. To use PageNavi on multi-page posts you need to apply the change you mentioned to the single.php file which is used for single posts. The wp_link_pages() function is in the middle of the post loop. If you’re going to modify that file, or any other theme file, I’d recommend you use a child theme. You can download a child theme from the Hueman web site or install it from within the theme itself. Let me know if you have any other questions.

    Thread Starter twirth5

    (@twirth5)

    Thank you for your hard work and quick response.

    Having recently moved from WP.com to WP.org, I am a relative noob to the Child Theme and it is a bit over my head–I apologize for this.

    Using Appearance > Editor, I see the wp_link_pages code in single.php.

    I do not want to blow up my site. So, I need to do this?

    1) Download the hueman child theme (hueman-child-master.zip).
    2) Upload the zip file using Add New Theme > Upload Theme > Choose File. I assume that the file will install in the appropriate hueman theme directory.
    3) Use Appearance > Editor on filename.php? and update the header with the single.php references.
    4) Use Appearance > Editor to update the wp_link_pages function with the PageNavi array statement from my original post.
    5) Finally, select Update in Appearance > Editor.

    Thank you in advance.

    bdbrown

    (@bdbrown)

    I am a relative noob to the Child Theme and it is a bit over my head–I apologize for this.

    No apologies needed; that’s why the forum exists.

    1) yes
    2) yes
    3) Make sure the child theme is activated.
    4) Using FTP or cPanel on your host, copy the single.php file from the parent theme folder /wp-content/themes/hueman to your child theme folder.
    5) In Appearance > Editor, the default file opened will now be the child theme style.css file.
    6) Select the single.php file from the file list on the right.
    7) Make your changes to single.php, then Update.

    Your site will then automatically use the single.php file in your child theme. When you update the parent theme the files in your child theme won’t be replaced so your changes will remain in effect.

    Thread Starter twirth5

    (@twirth5)

    What you have just explained to me cut through hours of ambiguous online research on the Child Theme issue and I hope that it helps others.

    Since it is now clear what I need to do and that it is nearly impossible to blow up my Web site doing so, I now have the confidence to do this.

    Thank you for your hard work.

    P.S. I will be back to mark as “resolved.”

    bdbrown

    (@bdbrown)

    Glad to help. You can leave the topic open in case you have any further questions on this specific issue. Otherwise mark it resolved whenever you’re ready.

    Thread Starter twirth5

    (@twirth5)

    So far so good. human-child-theme has been updated. I have copied single-php using cPanel and restored Jetpack Edit CSS.

    Questions per instructions here: https://tidyrepo.com/wp-pagenavi/

    The only place that I can find <?php wp_pagenavi(); ?> is in pagination.php and it is located in the hueman/inc subdirectory.

    1)Create a /inc subdirectory in hueman-child-master?
    2)Copy hueman/inc/pagination.php into hueman-child-master/inc/?
    3)Edit this to reflect the pagenavi array statement “<?php wp_pagenavi( array( ‘type’ => ‘multipart’ ) ); ?>”?

    bdbrown

    (@bdbrown)

    The /inc/pagination.php file is used by index.php and archive.php. It already contains the code to implement WP-PageNavi; all you need to do is install and activate the plugin. For multi-page single posts you need to modify single.php as described in your link:
    1. Copy single.php to your child theme.
    2. Find this line in the <div class="entry"> section:

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

    3. Replace that entire line with this:

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

    Then your multi-page posts should display the pagenavi paging.

    Thread Starter twirth5

    (@twirth5)

    That did it!

    Thank you for your quick responses and hard work.

    Case closed . . .

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WP-PageNavi in paginated posts’ is closed to new replies.