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

SpidermanPuddin on "Select Query for Taxonomy Meta Data"

$
0
0

I'm trying to query by custom meta data from a taxonomy. I haven't been able to get a Select Query to work so I have a work around:

$queried_object = get_queried_object();
	$series_id = $queried_object->term_id;  

	$volume_array = array();

	$volume_list = get_terms("volume", array( 'hide_empty' => 0 ) );
	if( $volume_list ){
		foreach( $volume_list as $volume ){
			$t_id = $volume->term_id;
			$term_meta = get_option( "taxonomy_$t_id" );
			if( $series_id == $term_meta['series_value'] ){
				$volume_array[] = $t_id;
			}
		}
	}

I know there has to be a better way to do this.


Viewing all articles
Browse latest Browse all 8245

Trending Articles