This snippet pulls in post "industry" for the current post
$post_meta = get_post_meta( $post->ID );
This code pulls in all the logos for the "brands"
<?php query_posts( 'post_type=brands&orderby=title&order=ASC&posts_per_page=-1' );
$i = 0;
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<li id="feature<?php echo $i; ?>"><a href="<?php the_permalink(); ?>" rel="<?php echo $i; ?>"><image src="<?php echo get_post_meta( $post->ID, 'brand_logo_sm', true ); ?>" /></a></li>
<?php $i++; endwhile; wp_reset_query(); ?>
I need some help limiting the the above code to ONLY display the brands that match the "$post_meta"
If have tried:
<?php query_posts( 'post_meta=brand_industry&orderby=title&order=ASC&posts_per_page=-1' );
With not lock.
Any tips?
Thx!
Function where I declare the meta:
$brand_meta = array(
'brand_email' => 'Email',
'brand_url' => 'Website',
'brand_stores' => 'Global Store Locator ID',
'brand_gallery' => 'Gallery ID',
'brand_products' => 'Products',
'brand_industry' => 'Industry'
);
Answer to comment below:
This code, outputs all the logos.
<?php query_posts( 'post_type=brands&orderby=title&order=ASC&posts_per_page=-1' );
$i = 0;
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<li id="feature<?php echo $i; ?>"><a href="<?php the_permalink(); ?>" rel="<?php echo $i; ?>"><image src="<?php echo get_post_meta( $post->ID, 'brand_logo_sm', true ); ?>" /></a></li>
<?php $i++; endwhile; wp_reset_query(); ?>
I only want it to display the logos if the "industry" gets outputted using this code:
<?php $post_meta = get_post_meta( $post->ID ); ?>
is equal to X
Thant make sense?