Support » Plugins and Hacks » Conditional Display of Template Info?

Conditional Display of Template Info?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did you ever get this working? I need to know the same thing – I want to hide the twitter and facebook icons I am displaying is users don’t add a url. Thanks.


    I came across this issue a while ago and manged to get some help elsewhere. I can’t remember where but I’ve got the code from a previous site that I was able to reuse when I couldn’t find the answer here.

    Anyway, this can be placed in an author.php file to call fields from the plugin. It’s setup basically to show a Facebook Icon then the word ‘Facebook’ as a link to the URL.

    $user_id = $curauth->ID;
    $key = 'people_lists_facebook';
    $single = true;
    $the_field_i_want_to_display = get_user_meta( $user_id, $key, $single );
    $the_field_i_want_to_display = nl2br($the_field_i_want_to_display);
    if ($the_field_i_want_to_display == '')
    { ?>
    <p>Text to show if nothing entered into field - delete if nothing to go here.</p>
    <?php } else { ?>
    <img src="http://www.website.com/images/facebook_16.png" style="margin-bottom:-5px;">
    <?php } ?>

    Hopefully that helps somebody!


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional Display of Template Info?’ is closed to new replies.