Class 'PG_Pagination' not found


I’m converting an HTML Theme to Wordpress, following the huge amount of documentation about it (in some cases it’s confusing because they are older versions and the UI doesn’t match).

It seems that so far, setting up pages, posts, titles, links, loops… with the smart actions is very easy. But I had a problem when I got to the pagination.

At the moment of saving I get a warning like this:
Quick export was done. But the Whole Theme Export is needed to apply changes to Pagination.

And in the preview it looks like this:

I have already configured to show a maximum of 2 posts per page and I have 4 test posts.

I hope you can help me, thank you very much.

Hey @miltonardila,
I have to explore this a little further, but with regards to the full export - Under the WordPress menu the top item is to export the theme. Maybe there were changes to the functions.php that aren’t exported with just a save. Can you try that and see if it fixes your problems?

Hi @RobM,

Sorry to reply after several days, tasks are piling up and some are more of a priority.

I’ve gone back and exported the theme completely, and I still have errors.

Hi @miltonardila,
I’ll set something up locally to test pagination. You are using the latest Pinegrow version?

Thank you for your support.

Pinegrow: 6.4
Local: 6.3.1
Wordpress: 5.9.1
MySQL: 8.0.16

Download link of the project:

Hi @miltonardila,
So I tested out pagination with your project. For the loop I added a smart actions Show Posts with the following settings:

Then for the pagination I added the pagination smart action:

Then I saved the page and exported the whole theme. Worked just fine.
You may want to delete everything out of the folder in your WordPress that you are exporting into before doing the theme export. Basically start fresh.
Let me know if this works,

1 Like

Thank you very much for your help, I have done the same steps you sent me and now it works. I will have to make some modifications in the but everything has been fine.

Why the solution was to change the type of Loop?

It’s just to understand how it works and learn how to use it to convert HTML templates to Wordpress.
When you tell me to delete everything and start again, is it for something special? My client has given me his html template and wants me to convert it into a Wordpress theme.

Thank you again for your help.

Hi @miltonardila,
I’m not sure where you had set your number of posts. The main post doesn’t allow setting the number of posts per page inside the query. It also doesn’t have an option to paginate.

I told you to delete everything in the export folder because I was concerned that there had been an earlier glitch in exporting that was still giving problems. Since Pinegrow can regenerate the whole theme it never hurts if you are getting odd errors.

I have configured the number of posts in Wordpress (according to the web tutorial), from the reading settings.