• redkite

    (@redkite)


    I’m using a customized author template and have successfully collected custom meta information for an author’s business industry within the user profile.

    I want to have a page/post that will display only the authors with a similar industry meta field – like where author’s industry is equal to ‘Graphic Design,’ for instance.

    I have:
    <?php echo $curauth->industry; ?>

    I want a page/post to show a list of all authors where ‘industry’=’Graphic Design’

    Does that make sense and is it possible?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Try:

    <?php if( $curauth->industry == 'Graphic Design') ):?>
    [ do stuff ]
    <?php endif;?>
    Thread Starter redkite

    (@redkite)

    For the [do stuff] part – how do I print the meta_value for a certain meta_key for the selected industry?

    I can use this to display the meta_key’s meta_value for a certain user_id:

    <?php the_author_meta( company, 8 ); ?>

    But I don’t understand how to tie that to the selected industry… I tried this but doesn’t work:

    <?php
    	$industrycat = $wpdb->get_results("SELECT user_id FROM $wpdb->usermeta WHERE meta_value='Web/Interactive'");
    	foreach ($industrycat as $industrycat) {
    	echo the_author_meta( 'company', '$industrycat' );
    	}
    ?>

    Redkite,

    Did you find an answer to your original question above?

    I’m trying to do the exact same thing. Any help would be GREATLY appreciated.

    I may be able to supply a page template that would select user_ids with a single meta_key/meta_value pair, and list data about each user_id. The drawback is that the meta_key/meta_value would be hard coded, not selectable, as would the data listed.

    If this is of interest, please tell me what data you would like listed for each user_id.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Only display list of authors with specific author meta’ is closed to new replies.