WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. computersimple
    Member
    Posted 1 year 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?

    http://wordpress.org/extend/plugins/people-lists/

  2. lynmangoro
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

    Hi,

    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.

    <?php
    $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;">
    ">Facebook
    <?php } ?>

    Hopefully that helps somebody!

    Nick.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic