Title: PHP if elseif else &#8211; universal
Last modified: August 31, 2016

---

# PHP if elseif else – universal

 *  [lunarmax2](https://wordpress.org/support/users/lunarmax2/)
 * (@lunarmax2)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-if-elseif-else-universal/)
 * Hi everyone 😉
 * Regarding PHP if elseif else…
 * 1. I want it to work In all pages where the code will be used.
 * 2. if there is no “taxonomy download_artist”, then display the default “Author
   code” instead.
 * 3. My download_artist (taxonomy) and Author code is working fine the only issue
   im facing is with PHP if elseif else!
 * My example which does not work:
 *     ```
       <?php if { ?>
   
        <?php $artist = get_the_term_list( $post->ID, 'download_artist', '', ', ', '' );
       	        if (!is_wp_error( $artist ) && '' != $artist ) {echo '<div class="text-muted text-sm text-ellipsis">'. esc_html__('by ','musik') . $artist .'<i class="fa fa-check-circle text-wildstuff"></i></div>';
       	        } ?>
   
       <?php } else { ?>
   
               <?php if( get_theme_mod( 'show-author' )){ $user_id = $post->post_author;echo get_user_link($user_id); } ?>
   
       <?php } ?>
       ```
   
 * Please help thank you!

The topic ‘PHP if elseif else – universal’ is closed to new replies.

## Tags

 * [else](https://wordpress.org/support/topic-tag/else/)
 * [elseif](https://wordpress.org/support/topic-tag/elseif/)
 * [if](https://wordpress.org/support/topic-tag/if/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [lunarmax2](https://wordpress.org/support/users/lunarmax2/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/php-if-elseif-else-universal/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
