There are probably many problems here, starting with the use of query_posts()
for a secondary query.
The proper method is new WP_Query()
, passing the relevant arguments. For example
$featured_query_args = array(
'post_type' => array( 'post', 'page' ),
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => (int) $featured_num,
'post__in' => (array) array_map( 'intval', et_get_option( 'aggregate_feat_pages', '', 'page' ) )
);
$featured = new WP_Query( $featured_query_args );
if ( $featured->have_posts() ) : while ( $featured->have_posts() ) : $featured->the_post();
// Loop markup here
endwhile; endif;
wp_reset_postdata();
Note: this is untested example code, to help you construct a proper secondary query and loop.