Timeline for Custom post type pagination not working in index.php file
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 26 at 16:43 | history | edited | fuxia♦ |
edited tags
|
|
Feb 26 at 16:06 | answer | added | Tom J Nowell♦ | timeline score: 4 | |
Feb 26 at 14:28 | comment | added | Vivek Saha | Thanks for your answer. Can you give me some code snippets. I am very new to wordpress and couldn't understand what you just said. @TomJNowell | |
Feb 26 at 14:24 | comment | added | Tom J Nowell♦ |
pagination operates on the main query, and it's the main query that determines if it's a 404 or not. If there is no page 2 for the homepage then it will 404, even if your custom query has multiple pages. If you want to change the main query, use pre_get_posts filter to change its options, don't create a brand new query with WP_Query /get_posts /query_posts . Also note that index.php is not the homepage template, it's the fallback template for all pages. Use home.php or frontpage.php instead
|
|
S Feb 26 at 13:58 | review | First questions | |||
Feb 26 at 16:11 | |||||
S Feb 26 at 13:58 | history | asked | Vivek Saha | CC BY-SA 4.0 |