The problem was in the same name for category slug “categories” and the same for the custom page that was holding all categories with the same name “categories”.
I have solved that by changing categories slug (in permalinks settings) to singular “category” and I have left custom page as plural “categories”.
If somebody know about some better solution, please let me know, thanks.
P.S. I was thinking about deleting this question, however, I think thinks is an interesting problem and maybe somebody will find it helpful. But If any moderator think it’s ot worth of sharing, you can delete this question.
Related Posts:
- Page template query with WP_Query
- Custom WP_Query order by post_meta and (author) user_meta
- Add and in the header while looping over custom query in page template
- Which custom query am I in and how can I access its properties & methods?
- Transient pagination not working properly
- Pass the same object to multiple widgets in a template with one query
- How to output different posts per page?
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- Multisite pagination issue by multi query archive 404
- Is there a reason why Pages are not publicly_queryable?
- Yoast primary category query modification
- Notice thrown when creating numeric pagination on custom query
- WP_Query custom order and pagination
- I am officially missing something about transient posts
- Pagination of custom page with custom fields query
- Why pagination is not working with tax_query param?
- Custom pagination (Title, date and teaser)
- Pagination is not working on custom query inside a custom home page template
- Pagination in custom query in a category page
- Horizontally paginate through sets of blog posts?
- Pagination in WP query with transient API
- Get next post when using pagination with WP_Query?
- Search results stuck on page 1
- order by numeric value for meta value
- WP_Comment_Query pagination, delving into the unknown
- Sort posts by category name and title
- Query causing load because of SQL_CALC_FOUND_ROWS post counting?
- Highlighting Sub topic in a post?
- Pagination wont work with search results template [duplicate]
- Pagination Not working on Home Page with 2 Query
- Best Practice For Querying Grandchildren?
- how to retrieve specific product attribute value in an sql query?
- Two queries on the same page with pagination
- Targeting specific pages in the loop
- WordPress custom archive page
- WP_Query pagination not working in admin area
- What are the differences between “Latest Posts” and “Static Page”?
- Pagination Issue: Custom Post Type In Index
- Retrieve or Query Pages by ID
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- How to do a query on custom taxonomies that is uncategorised?
- Pagination working everywhere but the index page
- Empty tax_query array returns an empty array
- How do I search inside specific taxonomies in WordPress
- How to correctly pass values to wpdb->prepare()?
- Setting get_queried_object
- remove query arg from url after set query
- difference between like ‘%%%var%%’ and ‘%var%’
- How to set pagination to work with ‘/page/’?
- WP_Query Pagination on multiple-loop page breaks WP or doesn’t show up
- Sort query by author: 1 author, then others
- Overwrite YoastSEO meta-tags with another page’s [closed]
- How to orderby multiple meta fields if some fields are empty
- How to duplicate 5 posts out of WP_Query results?
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Slow queries on a huge database
- Pagination links missing for first link (1) and previous button? How to get pagination links to work?
- How to return a 404 when custom query matches nothing?
- Query with relation and one without relation using multiple taxonomies?
- Display custom tags on pages that have a specific page parent
- How to get all author posts outside of author templates
- Transient api Caches confused
- How can I override one post and make it display content for another post?
- Append URL query to next post link in custom query
- Exclude parent with child pages from WP_Query
- Get multiple users with meta value in one query and populate WP_User class
- Pagination is not working with custom query inside a homepage template
- Display single most recent post in category on every page of category archive
- WPQuery calling specific posts problem
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- Start Query from 2nd Post without offset
- Display upcoming events in the next 30 days by querying posts with timestamp in custom meta
- WP_Query Pagination
- WP_Query, Paginate by Custom Field
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- How to query users by post count no less than 10
- 404 page on custom search pagination
- display the children of the post using the current page as the main parent
- WP_Query about meta_key and its array value
- Paging works correctly on local version, but not live?
- Create global array to compare inside a query
- Pagination not working in custom loop WP_Query
- Paginate nested query of child posts
- Filter posts/pages by user_role array
- previous_posts_link not working in WordPress pagination
- Issue in If else condition [closed]
- Pagination not working with WP_QUERY
- WP_Query with meta_value_num and meta_query not paged correctly
- Pagination with WP_Query not working
- wp_query pagination links producing 404
- Hierarchical List Pages as a table
- Custom post types loop on a page template
- WP_Query breaks pagination
- paginate_links() with Custom Taxonomy
- difference between methods of query
- Pagination problem with multiple loops on the same page
- how to use transient method?
- Use value from meta key array for use in WP_Query
- Pagination only showed when no category is set in wp_query
- taxonomy-{term}.php terms pagination returning 404 after a certain page