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

Collect Data from NEXT item while in loop

As you posted no code and little in the way of exactly what criteria you are using, I can’t really writ functioning code but inside your Loop try: var_dump($posts[$wp_query->current_post -1]->post_title); That is, $posts[$wp_query->current_post -1] is the previous post. You can change -1 to plus or minus whatever value you want but the math cannot result … Read more

Custom field Search with Relavanssi

I don’t have Relevansii installed but it looks like you can hook to relevanssi_search_ok and return false, and Relevansii will pass back the unmodified search. add_filter(‘relevanssi_search_ok’, ‘__return_false’); I am going to assume that Relevansii is using the ordinary search form provided by the theme, meaning that you could modify, or create, searchform.php to include the … Read more

Output custom field as ul list

You are using get_post_meta incorrectly. As you use it, it will return an array – you cannot explode an array. See the codex on get_post_meta(); If you pass true as the third parameter, this tells the function to return a string. So, $list_items = get_post_meta($post->ID, ‘idid’, true); should work.