My listing has a custom attribute that uses the fieldtype “checkboxes”. I am trying to get the values that the user selected for those checkboxes so that I can display them in the template.
The field name is event_type. Users can selected multiple values, for example (concert, party, workshop) and I want to display them next to the category name.
The line I am having issue with is this:
<a href="url_here"><?php echo esc_html( $eventType ); ?></a>
How do I get all eventType values that were selected?
Thanks!
@luna I can’t seem to get the values from the get_{key}() function. The values are listed as terms with the taxonomy name being hp_listing_{key}, so you can fetch them like so:
Hi, I’ll take a look at the code but maybe as an easier work around you can use the listing tags, as the event type instead. Then display them wherever you like in the template. I’ve done this before and it worked great. Not sure if in your use case it is what you want or not though.
Thank you both @aqmiami7 and @apos37 !
I was able to get the name using @apos37 suggestion! @aqmiami7 I am not sure I understand how that would work. I am still learning about WP and HP. This is an attribute a vendor has to choose when creating a listing , so I am not sure how they would choose that as a tag.