Skip Navigation

[Resolved] Ordering Repeatable field groups by using a custom field of parent Post

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a custom post type that contains one date field, as well as several repeatable field groups (RFGs). I would like to create a View of one of the RFGs and sort those results by the parent post's custom date field.

Solution: It is not currently possible to sort or filter a View of RFG by a field in the parent post. Instead, you could create a View of the parent post type and sort those results by the date field. Then create another View of the RFG, filtered by post relationship/RFG post owner, set by the current post in the loop.

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1403995
Screenshot (26).png
Screenshot (25).png
Screenshot (23).png

I have a custom post type for current affairs. I created a content template to display the custom fields of post type.
In my content template, I created 5 categories of current affairs each category is of repeatable filed group type and each repeatable group contains three custom fields [image, single line and multiple line fields].
Apart from that there is one more custom field - 'Date' to search the posts by date.
I also created a current affair section in Homepage of my website where I want to put only heading of the recent current affairs ordered by my custom field - 'Date'.

[1] What I did is that i created views for each category having repeatable field group. When I'm trying to order current affairs using custom field 'Date' it is showing NO ITEMS FOUND .When ordering is changed to 'post-date' it displays all current affairs for that particular category, but i want to display current affairs of particular date at a time.

[2] I also want to redirect an user to see more current affairs when they click on "View more". I'm not sure about how to get the post url of parent post repeatable filed group.

#1404995
rfg-parent-1.png
rfg-parent-2.png

[1] What I did is that i created views for each category having repeatable field group. When I'm trying to order current affairs using custom field 'Date' it is showing NO ITEMS FOUND .When ordering is changed to 'post-date' it displays all current affairs for that particular category, but i want to display current affairs of particular date at a time.
Okay it is not possible to order a View of Repeatable Field Groups by a custom field from their parent Current Affair post. Instead, you could create a View of Current Affairs, ordered by this Date field. Sort and filter this View first. Then inside that View of Current Affairs, you could place a nested View of International RFG, where the RFG owner is set by the current post in the loop.

[2] I also want to redirect an user to see more current affairs when they click on "View more". I'm not sure about how to get the post url of parent post repeatable filed group.
You want to display a link to the RFG's parent Current Affairs post? You can use the Fields and Views button to insert "Post title with a link". In the popup, use the Post Selection tab to select the parent Current Affairs post (see the screenshots). The system will generate the appropriate shortcode.

#1405241

My issue is resolved now. Thank you!