Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

masterbip on "WPAlchemy, grouped by category but need sort by custom meta field, please help!"

$
0
0

Please … it’s been days and can’t figure it out …

WPAlchemy is simply the best … but .. here is the thing:

I got “materials” in category (taxonomies) and “family” (drop down meta field option), example:

Wall
- wood
– glass
Door
- rock
- stainless steel

I am able to group and show all the “materials” posts grouped by category, but cant figure it out to sort them by type.
I am using ’mode’ => WPALCHEMY_MODE_EXTRACT in my functions.php

This is really driving me crazy, please I really need your help, please.

This is my query to list items but cant automatically sort it by 'tipo'

<?php

	global $catalogo_mb;

	$posts = get_posts(array(
		'post_type' => 'tipo-aislacion',
		'taxonomy' => $category->taxonomy,
		'term' => $category->slug,
		'nopaging' => true,
		'post_per_page' => -1,
		'orderby' => 'meta_value',
		'meta_query' => array(array('key'=>$catalogo_mb->get_the_value('family'))),
		'meta_key' => $catalogo_mb->get_the_value('family'),
		'order' => 'ASC'
	));

	foreach($posts as $post):

	setup_postdata($post);

	$catalogo_mb->the_meta();

	$tipo = $catalogo_mb->get_the_value('family');

 ?>

Thanks really so much in advance. I know this must be easy for a lot of you guys out there, its been days without a solution. Please, thanks again !!!


Viewing all articles
Browse latest Browse all 8245

Trending Articles