Support

Account

Home Forums General Issues Unable to retrieve data from checkboxes field added to a taxonomy

Solved

Unable to retrieve data from checkboxes field added to a taxonomy

  • Hi

    Excellent plugin, I’ve only just discovered it and it was a breeze to add checkboxes to my custom taxonomy.

    Unfortunately I’ve hit a stumbling block with retrieving the data. I’ve read through the documentation but still can’t manage to retrieve the data saved to the custom field.

    So, I have a simple checkbox with 3 options added to a custom taxonomy. The field name is “master_directory_category” and the custom taxonomy is called “directory_tax”.

    Can you please provide guidance as to how I can create the following workflow (from within a PHP template file):

    For each of the checkbox options of master_directory_category, display a clickable list the terms belonging to “directory_tax” which have that first option of the checkbox selected.
    Repeat for the remaining 2 options of the checkbox custom field.

    {some terms within the custom taxonomy will have multiple checkboxes selected but it’s ok to list them again if they have that particular checkbox option selected}

    My output should be similar to:

    Option1
    – sport
    – fiction
    – history

    Option2
    – crime
    – sport

    Option3
    – history
    – crime
    – sport
    – romance

    Hope you can help me!

    Thanks.

  • Hi @keith

    I am not 100% sure I understand what the issue is, but perhaps you are having difficultly loading the taxonomy term’s custom field value?

    Please read this doc to learn how:
    http://www.advancedcustomfields.com/resources/how-to/how-to-get-values-from-a-taxonomy-term/

    Please feel free to post code if you are having difficultly getting it to work.

    Thanks
    E

  • Hi Elliot,

    Yes that’s exactly what I was looking to do and while I couldn’t figure it out before from reading the documentation, inspiration suddenly hit me from re-reading it and I got it working.

    thanks
    Keith

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

The topic ‘Unable to retrieve data from checkboxes field added to a taxonomy’ is closed to new replies.