Thank you for contacting us here in the Support Forum
This is a query regarding basic PHP and WP API issues, and we usually do not support custom code which is not related to Toolset API or how-to's/issues in this very forum.
The Code you are using is not getting any custom fields (post_meta) to display.
It also just returns a array of posts, so you would need to first (after you get all your posts) construct a for-each loop, and in this loop, get the post_meta for each post (get your fields )
Then, you can display them however you like.
As a example, you could use something like this:
Get some content first
//get your posts
$all_posts = get_posts(array(
'numberposts' => -1,
'post_type' => 'your_post_type')
);
https://codex.wordpress.org/Template_Tags/get_posts
Then, foreach over those and get more details
if( $all_posts ){
foreach( $all_posts as $single_post ){
//Example on how to get post_meta below:
$single_returned_post = get_post($single_post);
$single_post_id = $single_returned_post->ID;
$custom_field_one = get_post_meta($single_post_id, 'your_custom_field_slug', true/false);
//Etc
}
}
Then, you can echo all data you collected above with your preferred HTML
Also, not that you need to close PHP tags before you can proceed with HTML in a PHP file (just as you did), OR you can to use:
echo 'your HTML here';
Please consult the PHP DOC and WP API DOC in regard to gather all needed knowledge to this custom code here:
https://developer.wordpress.org/reference/functions/get_post_meta/
hidden link
hidden link
hidden link
Please let me know if you have further questions regarding the issue mentioned in this Thread
Thank you for your patience.