Order custom fields alphabetically
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>’ ; … Read more