How to: Fix Blog Module pagination issues

by | Tips & Tricks

Below is an extract from our ‘Tips & Tricks‘ page.

In Divi 3.0.72, AJAX pagination was introduced which caused a problem with the text in the button described in Tips & Tricks ‘How to: Change ‘Read More’ text on the Blog Module to an Animated Button’ to revert to ‘Read More’ on any page other than the main blog page i.e. on page 2, 3 etc. Furthermore, this also caused a related issue of page numbers not being displayed in the URL. This problem can be fixed by switching off AJAX in the blog module. However, there is no facility to do this in the existing blog module, so we need to create a custom blog module that provides this functionality.

Custom Blog Module

Eduard Ungureanu from ET has created a ‘Custom blog Module’ that adds the functionality of switching off AJAX pagination to the blog module. See Eduard’s github for Ajax Pagination.This process requires access to you child theme via FTP. So here goes:

  1. Create a new folder inside your child theme called custom-modules
  2. Inside the new folder create a new PHP file called cbm.php
  3. Put the PHP code below in the cbm.php file
  4. Put the PHP code further below in functions.php

Create a new folder & copy cbm.php to it

Via FTP (Filezilla or whatever application you use), create a new folder in your child theme (wp-content | themes | Divi-child) called ‘custom-modules’

How to: Fix Blog Module pagination issues

Copy the code below to a text editor e.g. Notepad++ and save the file as cbm.php

Copy the cbm.php file to your new custom-modules folder via FTP

How to: Fix Blog Module pagination issues

Add code to functions.php

Now in wp-admin, go to Appearance | Editor and select the functions.php file. Add the following code to your functions.php

That it. You will now have a Custom Blog Module available in your child theme and will notice that there is the new option of ‘Use Ajax Pagination’ with a ‘Yes/No’ switch towards the bottom of the Blog Module Settings | Content, just below the original ‘Show Pagination’. Turn the ‘Use Ajax Pagination’ switch to NO. See below:

How to: Fix Blog Module pagination issues

Many thanks to Eduard Ungureanu for both creating this code and for pointing me towards it via Divi Support. This Ajax Pagination switch should be built into Divi (IMHO)

Signup for the iConnik quarterly newsletter

Thanks. You have successfully signed up

Share This