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
- Rewrite URL custom search query
- Multiple queries and pagination
- Sort WordPress Posts Meta value by Week not Day
- How to get all author posts outside of author templates
- How do I get my custom query to work with search results after the first page?
- Query only the posts with a post format of “audio”
- Modify Search Query if original Query gave no results
- How to cache wp_query with pagination using transients?
- Is_single() conditional tag returns null in query
- 2 wordpress loops showing 1 post from same post type – how to avoid showing the same post?
- Pagination only won’t work in author template
- Removing duplicate values between two wordpress queries
- Transient api Caches confused
- How can I override one post and make it display content for another post?
- Include current post into loop
- Is it possible to query from external database? [duplicate]
- Append URL query to next post link in custom query
- Can’t sort custom post type by random
- pre_get_posts – Trying to get property of non-object warning
- Exclude parent with child pages from WP_Query
- Query posts that contain video?
- Get multiple users with meta value in one query and populate WP_User class
- WordPress query posts with multiple post_meta data
- wp query error while paging the posts
- new WP_Query messes up pagination
- Pagination is not working with custom query inside a homepage template
- Display single most recent post in category on every page of category archive
- Include latest author posts with pagination in single template?
- Filter post query to only show direct children of category
- Get a list of posts by specific category
- Show a 404 error page if Public query variable’s value doesn’t exist?
- Pagination works in custom query loop but it doesn’t work in shortcode
- WordPress Custom Search Form Displaying Unexpected Results
- “paged” in WP_Query returns 0 posts
- Is there a way to make this kind of loop shorter and nicer?
- How to check the array values, what WP_Query has brought to me?
- Why won’t pagination work?
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- How to set up hierarchical relationships without using plugins / meta query
- How to add custom meta to ‘pre_get_terms’?
- Pagination on template page for custom query redirecting to index.php
- Set front_page programatically after user login via query, while leaving site option alone
- Create a loop on my pages with new “WP_Query”
- Utilising an existing page while using the “s” query parameter
- All blog data on a page using custom query gives 404 for page 2 and onward
- Shortcode for custom query not returning results when attributes are added
- Should I reset $wp_query?
- Query where ANDing slug values not working
- How to filter query loop block with a search string from the query parameters
- Update query for wp_posts and wp_postmeta
- Get posts in taxonomy randomly
- Page navigation doesn’t seem to work when I add offset?
- Get specific ACF key and value from all posts – no access to DB
- mysql query order by
- When listing child pages run out of memory
- WPQuery calling specific posts problem
- Pagination issue with tag.php
- wordpress udpate query not equal to
- How to generate feed for custom template
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- Pagination in html table is not working
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- Content not displaying on paginated page
- Display specific page (that is child) content on parent page
- Write WP Query that selects posts that are part of the same two categories
- Paging + WP Query
- WP_User_Query orderby meta_val_num
- Get query results with a page title
- How to get current page nearest parent id?
- How to get main menu only with wp_nav_menu
- How to SQL query posts IDs by categories AND authors?
- Second loop pagination changes URL, not content
- Include one page/post into query which is already returning posts
- Insert images into wordpress post with a query
- Query Not working as expected
- WP_query paged pagination with excluded category still counts it
- How to create single page site in WordPress