Home › Forums › General Issues › How to show older field from same category › Reply To: How to show older field from same category
The best I can do here would be pseudo code. This forum is really for helping with questions about ACF and what you need is help with basic WP queries and loops. It would be large project for me to code everything that you need here.
// this would be the main loop in your template
while(have_posts)) {
the_post();
// show the fields for this post
/*
get the category of this post - wp_get_post_terms()
get the date of this post - get_the_date()
do a WP_Query to get the next older post in same category
new WP_Query() with tax and date queries to get one post
Nested post loop to loop over secondary query and show fields
*/
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.