Timeline for How to Link to Most Recent Custom Post of Same Term
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 28, 2020 at 9:59 | comment | added | t2pe | I've not used that function before so I had a quick look at the Codex. It looks like you access the data in the object slightly differently to how you've done it, ie. $recent['ID'] as opposed to $recent->ID. In case thats relevant, check the examples at: developer.wordpress.org/reference/functions/wp_get_recent_posts | |
Jul 27, 2020 at 16:48 | comment | added | ZackAkai | Well I solved part of the mystery, I didn't realize I had a pair of unnecessary brackets in there that was preventing the link from displaying. So it at least now shows up. Still linking to the same page though. | |
Jul 27, 2020 at 16:39 | comment | added | ZackAkai | I think the issue might have something to do with the "foreach( $recent_posts as $recent )" bit, as removing that allows the link to show up on the post, but unfortunately it just links to the same post instead of the most recent. | |
Jul 27, 2020 at 16:31 | history | answered | mozboz | CC BY-SA 4.0 |