You did enter total number of posts/events as total page count. you should have passed total number of pages instead of total pages as “total” args. So to pass as total pages, you should calculate like TOTAL_POSTS/PER_PAGE.. so if you have 6 posts and you have 2 posts per page then it would be 6/2=3 pages.. so the “total” value should have been 3.. if you have 7 posts.. then it would be 7/2=3.5=4 pages.. PHP ceil function does that trick to round off to highest value.
So part of your code should be
$total=ceil($mycats[0]->category_count/$my_per_page);
Where $my_per_page would be your Per Page variable.
I hope this fixes your issue
Related Posts:
- WordPress /page/2 404 pagination problem – what to do?
- how to get pagination link url?
- add_rewrite_rule – working fine but broken for pagination
- How can I see all of a post’s comments on a single page as a reader, if pagination is enabled?
- Check if on last page of paginated post using wp_link_pages
- How to paginate a list of tags
- posts_per_page & pagination conflict
- How do I sort multiples pages?
- WordPress pagination on custom script
- Pagination is not working wp_query custom fields values
- Broken pagination
- pagenavigation not showing the next page just linking back to the main page [closed]
- Move pagination numbers above plug-ins
- Paginate get related post by author function
- Possible to paginate on single.php?
- Keep Pagination in Tabs
- Need help understanding pagination parameters
- redirect pages with no content, instead of 404 error, using max_num_posts?
- I want to change the media list with additionally query
- Content only on last page, if the page has pagination
- Custom query in archive.php with pagination nightmare
- Display post links under month in paginated archive
- How can I paginate image attachments in a post?
- Pagination shows same contents all pages
- Pagination (page/2/) displaying 404 on archive pages
- How to use “offset” to paginate get_users?
- How to test pagination? [closed]
- Link to previous month’s posts
- Limited number of paging to 10 “pages: 1 … 10”
- remove_query_arg() on rewrite rule
- Hide featured post on second page
- I cannot get pagination to work on my home page code. it keeps displaying the same posts
- Fetching more posts in WordPress via AJAX
- AJAX pagination offset returns same post on adjacent pages
- 404 on pagination but with a strange twist (error 404 only when there is single post on the second page)
- WordPress loading index page instead of archive.php
- Add additional first page, last page links to the_posts_pagination()
- Add icons in paginate_links()
- WordPress single page template, custom post type, pagination orderby title – alphabetical order
- wp_title() returns ‘page not found’ on page 2
- Homepage has Paged Pages that should not exist, like /page/2/ and on to /page/99999/
- Randomised Post Time
- WordPress paginate_links() function doesn’t generate properly links after apply filters
- Not refreshing content pagination on search result
- rewrite url with parameter or pagination beyond certain value does not work
- Single Page Views and Pagination View Depending on URL Query
- stop pretty pagination rewrite site.com/cat/2 => site.com/cat?page=2
- How checked checkboxes remember on all pages in wp_list_table pagination?
- Update to 4.4.1 breaks my pagination
- Category lists page foreach Paging
- Pagination on home page not working
- Using Ajax in the prev_posts_link and next_posts_link
- WordPress triggers 404 on page 2 for custom search query
- Search page pagination does not work
- Customise wp_List_pages to output a UL LI
- Pagination in home page for a custom loop loads same content
- Custom pagination code is not working
- Pagination doesnt show numbers
- where is wordpress search pagination
- How do I override all theme pagination throughout a site?
- Translating a pager string
- remove $_GET-parameter from WP_List_Table::tablenav
- Pagination, query more pages at once
- WP Page Navi. 404 error when using posts per page parameter [duplicate]
- Paginate_links only working on first page
- What is the best way to implement ajax based pagination on custom query based templates?
- Pagination in author, category, archive and tags pages does not work
- Custom post type pagination like “previous current/all next”
- what code to add to search.php
- How can I paginate results from get_children
- remove rel=next on category page (if
- Why can i add /page/674874 (or any number) to a URL and it still pulls up that page?
- GoBlog Free Pagination Issue
- Sidebar pagination posts not shown when sidebar is in single.php
- Override the WordPress default pagination markup
- how to Adding pagination on template page wordpress
- Custom pagination search in post type with meta key
- Prevent WordPress to remove query vars from url
- How to add pagination to custom page
- Pagination: Last Page Missing
- Google Indexed sub pages in wordpress pagination in post
- posts_per_page stop working after wordpress update from 4.2.1 to 4.6.1
- Why Am I getting an error when I add the number parameter to my WP_User_Query?
- Paginate Links function: Page 1 doesn’t work
- Pagination doesn’t work on static front page
- How to display most viewed posts without any plugins
- Search engine not working
- Pagination and Custom Search page
- pagenavi shows a lot of pages calculated from all posts in the site with query_posts
- pagination for blog landing page
- URL rewrite breaking pagination
- Pagination is not working correctly there is this wierd looping
- The pagination doesn’t work
- Pagination Broken on Loop using ACF
- margins in between pagination links [closed]
- Page navigation not working correctly on index but only on categories
- How to split long posts in multiple pages in twentysixteen
- Duplicating pagination on second page
- How to make infinite scroll by dividing the content?
- Change Pagination Default to “/2/” Query String “?page=2”