Hi everyone, I need some help here. I'm trying to populate a dopdown with titles of a custom post type.
I use this snippet to get posts:
$args = array (
'post_type' => 'customposttype',
'numberposts' => -1,
'post_parent' => '0'
'orderby' => 'title',
'order' => 'ASC',
);
$attivita = get_posts($args);
Then i use foreach to echo titles.
Unfortunately what I get is a list of titles of both the custom post type I want AND its children
How can I get rid of children using get_posts?