I am trying to:
Load child posts in the order that they show up on the wordpress admin panel.
Link to a page where the issue can be seen:
hidden link
Particularly the blue background sections with the title "Salesforce Products we Deliver"
I expected to see:
I expect the products in that section to display in the same order everytime. That order being the order in wich they are displayed in the wordpress dashboard where the list of that post types is
Instead, I got:
The products load in different random positions.
This is the code that I'm using on the theme to get the posts:
<?php
$post_id = get_the_ID(); // parent post ID
$child_posts = toolset_get_related_posts(
$post_id, // get posts related to this one
'industry-products', // relationship slug is identical to repeatable field group slug
'parent', // get posts where $post_id is the parent in given relationship
1000000, 0, // pagination
array('meta_key'=>'toolset-post-sortorder'), // no extra query criteria
'post_object', // return an array of post IDs
'child',// return the child post, which is the RFG in this relationship
'meta_value_num',
'ASC'
);
foreach ($child_posts as $child_post) { ?>
<?php
echo '<img src="' . types_render_field('product-white-icon', array('id'=>$child_post->ID, 'output' => 'raw' )) . '">';
echo '<h4>' . get_the_title($child_post->ID) . '</H4>';
?>
<?php } ?>