Timeline for Accessing $post global on a custom post type archive page
Current License: CC BY-SA 3.0
29 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 10 at 7:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jul 11 at 0:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Mar 10 at 7:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 7 at 23:49 | answer | added | DJ_Davey | timeline score: 0 | |
Oct 9, 2023 at 20:06 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jun 8, 2023 at 3:11 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 7, 2023 at 20:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Oct 10, 2022 at 5:07 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jun 9, 2022 at 21:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 6, 2022 at 3:06 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Oct 8, 2021 at 15:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jun 3, 2021 at 21:07 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 2, 2021 at 19:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Sep 26, 2020 at 13:03 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
May 20, 2020 at 13:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jan 11, 2020 at 6:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Sep 12, 2019 at 1:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
May 12, 2019 at 10:00 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jan 9, 2019 at 10:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Aug 4, 2016 at 18:47 | comment | added | Andy Macaulay-Brook | Is this question still current? What is it that you want to achieve on this template? | |
Nov 13, 2015 at 18:47 | history | tweeted | twitter.com/StackWordPress/status/665239553918304256 | ||
Nov 13, 2015 at 9:22 | comment | added | Tom J Nowell♦ |
It doesn't make a lot of sense to make use of $post outside the loop in a post archive, mainly because it yields the problem of "which post?" There are other functions that can provide more useful information though, such as the current post type and its labels, or the current category/tag/term
|
|
Nov 13, 2015 at 9:14 | answer | added | maddog | timeline score: 0 | |
Nov 13, 2015 at 9:08 | history | edited | any_h | CC BY-SA 3.0 |
deleted 1 character in body
|
Oct 15, 2015 at 7:15 | answer | added | Fiaz Husyn | timeline score: 0 | |
Oct 14, 2015 at 9:21 | comment | added | TheDeadMedic |
You can use if ( have_posts() ) $post = $wp_query->posts[0];
|
|
Oct 14, 2015 at 9:20 | comment | added | any_h | What alternatives there are outside the loop? | |
Oct 14, 2015 at 9:13 | comment | added | TheDeadMedic |
You should only use $post within the loop.
|
|
Oct 14, 2015 at 9:04 | history | asked | any_h | CC BY-SA 3.0 |