how to add pagination on foreach in wordpress

My code below basically gets a bunch of films from the db and sets the year as the array key then echoes out each film per year. Thats all cool although my results are getting to long and need paginating. I cant find any examples that help my situation as most pagination in php is for while loops – appreciate any help or feedback.
fisrt image of code

second image of code

Read more here: how to add pagination on foreach in wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *