Skip Navigation

[Resolved] Dynamically Populate Select Field Question 2

This support ticket is created 8 years, 6 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Mattnet 8 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#342698
Options.png
Groups.png

In reference to : https://toolset.com/forums/topic/dynamically-populate-select-field/#post-339548

I have taken this example and applied it. While it is working great, each select I have used it for returns only 5 options (or 5 posts) when there are actually 56 in one of them and a few hundred in the other one. How can I make it show all options (or all the posts)? And is it possible to sort those options alphabetically so that they show up in the Select field properly?

Thanks!

#342707

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please try to add following arguments to your get_posts() function argument and try to resolve your issue.

$args = array(
'posts_per_page' => -1, 
'orderby'=> 'title', 
'order' => 'ASC' ,
'post_type'        => 'policy',
 'post_status'      => 'publish');

$posts_array = get_posts( $args );
#342725

Wow! That did the trick! Thanks so much for the quick and directly to both points help!

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