Skip Navigation

[Resolved] Show repeatable field for all posts in custom post type

This support ticket is created 2 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 2 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#2240219

Hello team,

I have a custom post type "avtaler". I have also created a field group with a rfg (nedlastbare-filer). Inside the rfg I have multiple fields, including a toolset date field (dato).

I want to display and sort all rfg-fields for all the post in one list, sorted by date. (newest on top).

Can you help me in the right direction how to solve this?

#2240347

Hello,

It is possible with classic view, for example:
1) Dashboard-> Toolset-> Settings-> General, in section "Editing experience", enable option: Show both the legacy and Blocks interface and let me choose which to use for each item I build

2) Dashboard-> Toolset-> Views, create a post view:
- Query posts of your repeatable field group
- Order the result by post date
- do not need other filter
- In view's loop, display the post information + custom fields

#2240409

Thanks for your reply. I want to achive the same thing with php. Can you tell me how to construct the WP query to achive the same thing as you guided me for views.

Thanks 🙂

Best!

Svein

#2240411

You can follow WP document to setup your custom PHP codes:
https://developer.wordpress.org/reference/classes/wp_query/
For example:

$args = array(
    'post_type' => 'my-rfg-slug', // The repeatable field group slug
);
$query = new WP_Query( $args );

And you can also render the post view with in your custom PHP codes, for example:

$args = array(
    'name' => 'your-post-view-slug',
);
echo render_view( $args );

More help:
https://toolset.com/documentation/programmer-reference/views-api/#render_view
Renders a View and returns the HTML output.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.