It looks like you’re trying to output the wrong stuff. You’ve ordered the $post_objects
, not the $vMarca
. Try using the $post_objects
variable for your if
and foreach
statements thus:
<?php
$vMarca = get_field('tienda_marcas' , false, false);
$post_objects = get_posts(array(
'post__in' => $vMarca,
'order' => 'ASC' ,
'orderby' => 'title'
));
if($post_objects)
{
echo '<ul>' ;
foreach($post_objects as $post)
{
setup_postdata($post); ?>
<li><a href="https://wordpress.stackexchange.com/questions/91370/<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php the_content(); ?>
}
echo '</ul>' ;
?>