People Lists
Conditional Display of Template Info? (3 posts)

  1. computersimple
    Posted 3 years ago #

    Is there a way to create a condition for the display of specific info on a list template?

    For example if the user input a website url then display the link otherwise don't display the link?


  2. lynmangoro
    Posted 3 years ago #

    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.

  3. Agent8
    Posted 3 years ago #


    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!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • People Lists
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic