• Can anyone show me an example or point me to the right documentation for the following?

    How do I only show posts from authors who’s user meta value is true of a chosen value? For example in the profiles of my users I have a drop down box which allows them to choose their country, I can print the country to their descriptions, but What statement would I use to show a one page archive of say all of the posts from just users who have selected United States in there profiles?

    I’ve tried…

    ...loop start...
    $value = get_the_author_meta(get_the_author_ID(), 'country', 'united_states');
    if ($value != NULL) { ?>
    ...content...
    <? }
    ...loop end...

    and a few other attempts, but nothing seems to produce the results I’m after. Thank you for your time!

Viewing 2 replies - 1 through 2 (of 2 total)
  • In your sample above, the ‘united_states’ should be the value, so it would be:

    $value = get_the_author_meta('country', get_the_author_ID());
    

    … and also, the parameter sort order is reversed. Field parameter should come before author ID.

    Thread Starter theApe

    (@theape)

    So…

    $value = get_the_author_meta('country', get_the_author_ID());
    if ($value == 'united_states') {

    ?? Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_the_author_meta value?’ is closed to new replies.