WordPress.org

Ready to get started?Download WordPress

Forums

Participants Database
[resolved] Hiding a Field Without Data on pdb_single Page (11 posts)

  1. dhobeika
    Member
    Posted 1 year ago #

    Is there something I can add to the pdb_single so that if a certain profile field was not filled out, it won't display? For example, if on some of the profiles, the field for "age" was not filled out, it won't get displayed as "Age" with nothing next to it? I'd prefer that fields that don't have data associated with them because that part of the profile wasn't filled out don't display that field if there is nothing to display.

    I don't want to remove that field though because half the profiles have ages and the other half don't, I just don't want age to display on the half that didn't enter ages.

    http://wordpress.org/extend/plugins/participants-database/

  2. dhobeika
    Member
    Posted 1 year ago #

    Can anyone help with this?

  3. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    dhobeika,

    Yes, there is a way. When a field is blank, it's wrapping element is given a class of "blank-field" so you can alter how it is displayed in your theme stylesheet.

    The simplest thing to do is just:
    .blank-field { display:none }

    Note that these are general instructions, you may need to do things a little differently depending on your theme.

  4. dhobeika
    Member
    Posted 1 year ago #

    Thanks so much! This works great!

    One other question -- I have several photo upload fields. Is there any way to have the photos display as thumbnails (maybe around 150 px wide) and then people can click on the thumbnails to get a bigger image?

    I tried adding dd.photo_1 to my stylesheet and setting a max width of 150 px but that didn't work right.

    Thanks again!

  5. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    dhobeika,

    OK, the best way to resize images using CSS is to set either the height or width of the image and set the other dimension to auto like this:
    img { width:150px; height:auto }
    Don't use that code as-is, obviously! Your example has the selector "dd.photo_1" if it's the IMG that has the class of "photo_1" you'll be fine. The rule has to target the IMG tag directly. If you're expecting images smaller than that, you can use "max-width" to prevent enlarging the image, but you'll have to include "display:block" for it to work in most browsers.

  6. dhobeika
    Member
    Posted 1 year ago #

    How would I get the thumbnails to link to the full size image?

  7. dhobeika
    Member
    Posted 1 year ago #

    Is there any way to get the thumbnails to link to the full sized image? Thanks!

  8. ecn
    Member
    Posted 1 year ago #

    Please let me know where and how the field to hide empty fields would go in my theme css. I'm not sure where to paste the code and if it should be exactly as shown in the example above. Thank you.

  9. dhobeika
    Member
    Posted 1 year ago #

    Any update on how to get the thumbnails to link to the full-sized image?

  10. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    dhobeika,

    No this is not possible at this time.

    As an aside: it's best to post a new thread if you have a new question...this thread was resolved, so your new question was missed.

  11. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    ecn,

    This would go in your theme stylesheet.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.