Set an image on multiselect Custom Field

This topic contains 8 replies, has 3 voices, and was last updated by  f.daliessi 8 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #64349

    f.daliessi
    Expired Member
    Post count: 85

    Hi everybody,
    how can I set a custom image for every option in a Multiselect Custom Field?

    Here’s my problem: I setup a Custom Field that is used to choose which languages my final user speaks.
    I followed your tut here https://wpgeodirectory.com/docs/custom-field-examples/ but I can’t fully understand if I can do this with Multiselect option.
    I’d like to show a custom flag for every language selected. For example if someone choose English and Italian, I’d like to show GB and ITA flags.

    Like attachment

    Thanks in advance

    #64360

    Guust
    Moderator
    Post count: 29970

    You have to create a new custom field for each language.
    And set them up like the “pool” example.

    #64365

    f.daliessi
    Expired Member
    Post count: 85
    This reply has been marked as private.
    #64387

    Guust
    Moderator
    Post count: 29970

    Have a look at https://wpgeodirectory.com/docs/custom-field-examples/
    Look how to create the custom field for the pool image.

    What you have to do is create a similar custom field for Italian, another custom field for Spanish etc.

    As the tutorial says, it is “created using a checkbox custom field and an image background.”
    Not a Multiselect field.

    https://wpgeodirectory.com/docs/core-place-settings/#checkbox

    #64390

    f.daliessi
    Expired Member
    Post count: 85
    This reply has been marked as private.
    #64394

    f.daliessi
    Expired Member
    Post count: 85
    This reply has been marked as private.
    #64423

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    you can do that with CSS:

    
    
    .geodir_lingue .geodir-i-select, .geodir_lingue ul {
        float: left;
        margin: 0 !important;
        padding-left: 0 !important;
    }
    
    .geodir_lingue ul li {
        border: 0 none;
        float: left;
        margin: 0;
        padding-left: 5px;
    }
    .geodir_lingue ul li::after {
        content: ",";
    }
    .geodir_lingue ul li:last-child::after {
        content: "";
    }
    .geodir-entry-content {
        clear: both;
    }

    Let us know if this helps,

    Thanks

    #64464

    Guust
    Moderator
    Post count: 29970

    If you want to use flags, you need to apply different CSS code for each language you added as a checkbox custom field. Look for the CSS code for the “pool” field at https://wpgeodirectory.com/docs/custom-field-examples/

    If you want to use the multiselect, then follow Paolo’s suggestion.

    A URL would be handy too, so we can actually see the code you are using.

    #64653

    f.daliessi
    Expired Member
    Post count: 85

    Thanks for the code. Works perfectly

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket