is it possible to use a custom query instead of taxonomy in previous_post_link()?
Or do I have to build the prev/next links completely custom if I want to use them with a custom query?
I have a series of posts that are ordered by a meta_key value. They could also be arranged by menu order, if necessary.
I need next and previous post links in a single post page using a “page-builder” type of CMS—specifically the DIVI theme by Elegant Themes. So, I need the links to be able to appear using Shortcodes, as the controls in the template, along with a lot of the default template stuff, are hidden when you use the page builder. AND, my client needs to be able to manipulate where in the page layout the next/previous post controls appear, depending on the post type, as it’s a portfolio site and “sculptures” get treated with a different layout than “paintings”, if that makes sense.
I have a page with two sections, each uses a different WP_Query()
to pull in events
, which are a custom post type. Each WP_Query()
queries a meta_key
for the event date so that Section 1 only displays upcoming events
and Section 2 displays past events
.
I’m using get_next_post
and get_previous_post
(from the same category) to show the thumbnail and link to the respectives posts in my single template, but it’s in a very large db that is giving my server a hard time.
I’m using this code to display the thumbnail (featured picture) of the previous and next post (a custom post type called Blocks).
I am trying to use the next/ previous post link functions by WordPress to move between posts of a custom type based on the surname of a person.
I’ve got a custom post type (CPT) called event
. Every event has got an associated meta_key
called event_date
.