Timeline for Global $post shows null in some of my custom post types archive pages
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 18, 2017 at 10:45 | comment | added | Jacob Peattie | The global post doesn't have properties relevant to the post type archive, but could be set somewhere else. Maybe from the first post in the query, maybe from a custom query occurring somewhere else before the scripts are enqueued. I'm not sure enough about the order of things right now to be certain, but regardless of whether or not it's set, it's not something that should be used for determining archives for the reasons I outlined in my answer. | |
Nov 18, 2017 at 5:16 | vote | accept | mhuenchul | ||
Nov 18, 2017 at 5:16 | comment | added | mhuenchul | Good answer. Thank you a lot! But why when i do var_dump($post_type) still shows 'articulo' (length=8) in articulo archive page? Doesn't make any sense due your explanation | |
Nov 18, 2017 at 5:01 | history | answered | Jacob Peattie | CC BY-SA 3.0 |