Custom Icon for Events Category

Home Forums Calendar Products Events Calendar PRO Custom Icon for Events Category

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #961604
    Carl
    Participant

    Hey Team,

    I am trying to have a custom icon for individual Events category, in the advanced custom field i have assigned a text field to “Taxonomy Term to Event Category” so now on the events category section i can paste the image url to the category, now on calling the image the custom field cannot get the individual category. this is what i have done

    $categoryicon = get_field(‘icon-media-link’, ‘tribe_events_cat_’.$term_id);

    ” />

    but its not returning any value,

    But to display the category name this works

    $events_cats = get_the_terms($id, ‘tribe_events_cat’);
    <h3 class=”evnts-category”><?php foreach($events_cats as $i) {
    echo $cat_titles[] = $i->name;
    } ?></h3>

    please advice me how can i display an image assigned to the individual category.

    Thank you

    #961751
    Brian
    Keymaster

    Hi,

    Thanks for the interest in our plugins. I can try to help out, but I am limited in supporting customizations.

    That is from Advanced Custom Fields:

    $categoryicon = get_field(‘icon-media-link’, ‘tribe_events_cat_’.$term_id);

    However, the only thing that sticks out to me is where is the $term_id variable coming from?

    Does that have a value? That maybe the issue.

    I can try to help out some more, but again I am limited in supporting customizations and cannot troubleshoot each step.

    Cheers

    #962029
    Carl
    Participant

    Hey Brian,

    Really appreciate you taking out time to reply :).

    The value i am getting from is

    $terms = get_the_terms($id, ‘tribe_events_cat’);
    $term_id = $term -> term_id;

    The above code returns the term id of the post type registered with normal wordpress codex procedure.

    but some how it does not return us the id of the tribe events category, as we presume it is a custom taxonomy of Event Post Type.

    Is there a better solution to get id of single category term of Tribe Events in order to assign a custom icon.

    Regards

    #962075
    Brian
    Keymaster

    I think that is the best way to get the id of a single category.

    However, this

    tribe_events_cat_’.$term_id

    will not correctly combine the string (tribe_events_cat_) with the id.

    Look at the solution here:

    http://stackoverflow.com/a/11740277

    And see how it combines the word “check” with a variable. That is similar to how you need to do it.

    #971974
    Brian
    Keymaster

    Since there is has not been any activity on this thread for over 2 weeks so I am now closing it. Feel free to start a new thread if you have further issues. Thanks! 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Custom Icon for Events Category’ is closed to new replies.