Hide Non Populated Fields

This topic is: not resolved

This topic contains 7 replies, has 2 voices, and was last updated by  3rdcorner 9 months, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #168149

    idesigns
    Participant
    Post count: 1

    So I have a setup where I have Name, Phone Number, Image, Email….

    The issue I have is if the client does not have an email and this field is left blank. Then it still shows the email link I have setup in my custom template.

    Would it be possible to hide the field on the page if it is not popluatied in the array? Thanks for the help

    PHP Code

    fetchRecord()):
    $name = $Record->get_field('name');
    $phone = $Record->get_field('phone');
    $email = $Record->get_field('email');
    $website = $Record->get_field('website');
    $image = $Record->get_field('image');
    ?>
    <li class="agent" style="clear:both;">
    <?php if(is_array($image)) foreach ($image as $img) { echo ' '; } ?>

    <a href="mailto:">Email Me
    <a href="" target="_blank">Visit My Website


    #168151

    3rdcorner
    Member

    Following WordPress style tags I usually do something like this:

    Email Me

    #168152

    idesigns
    Participant
    Post count: 1

    Nothing came through on your post. Can you send me the link or something for me to look over. :)

    #168153

    idesigns
    Participant
    Post count: 1

    Actually I found this in the docs: http://mondaybynoon.com/20100104/pulling-pods-data/

    It seems to work perfectly… Thanks for the help. :)

    #168154

    3rdcorner
    Member

    Oops, I was suggesting something like this:

    Just wanted to post to see if the code tag works, I left it out and the code didn’t show up…

    #168155

    3rdcorner
    Member

    Trying again…

    Just wanted to post to see if the code tag works, I left it out and the code didn’t show up…

    #168156

    3rdcorner
    Member

    Trying again…

    <a href="mailto:">Email Me

    Just wanted to post to see if the code tag works, I left it out and the code didn’t show up…

    #168157

    3rdcorner
    Member

    I have no idea, but my code wont post in full

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Wordpress Cloud Hosting