ID & Slug?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #22189
    Christian
    Participant

    Hey all, i need the ID or the Slug of the Events Category. Where do i find them? i need it for is_category (events)..

    Any hints?
    Greetz Chrischan

    #22203
    Andy Fragen
    Moderator

    Christian, if you’re looking for the individual category slugs the following code will get them for you.

    function getCategorySlugs() {
    $terms = get_terms("tribe_events_cat");
    $slugs = array();
    foreach ($terms as $term) {
    $slugs[] = $term->slug;
    }
    return $slugs;
    }

    #22250
    Christian
    Participant

    Thank you for your answer but thats not what i mean!
    [code]

    [/code]
    What i need is the id or slug of the default “events” Category, cause i need to add a special css class to this.
    i.e.:
    events <<- default event Category, what is the id or slug that i can use for the if statement? Thats important!
    –Musik <<- Subcategory
    –Dance <<- Subcategory

    Thx, so long. Christian

    #22251
    Christian
    Participant

    #22252
    Christian
    Participant

    argh.. how can i embed code?
    if ( is_category( slug or id ) ) {
    // add cc class
    }

    #22259
    Andy Fragen
    Moderator

    Sorry Christian. It might be easier to start with what you are trying to accomplish.

    #22265
    Andy Fragen
    Moderator

    There is no “default” events category, nor does it appear that an uncategorized event have any specific CSS class or id associated with it. If this is what you’re looking for you might put it in as a feature request. In the mean time you could create an “Uncategorized” category and assign your uncategorized events to that. Then they would have a .cat_uncategorized CSS class.

    #22354
    Christian
    Participant

    Hy Andy, thanks for your trys but i think you dont understand what i need?
    check this: http://codex.wordpress.org/Conditional_Tags

    There must be a Page or Category for this. It works like this:
    if you are on a page or category with the id 17 or slug xyz you can put in code that affects the website only on this given ID/slug. Thats what i need.

    the default category of TEC is in my case “events” where all events are listed. you add the default category in the Settings of TEC.

    BUT: it looks like TEC doesnt work with standard WordPress Categorys?!
    The Slug wont work with the WordPress Function. i tried: if is_tribe_event that broke the site.
    i´m not very familar with coding php. i can read and modify it..
    Greetz Christian

    #22367
    Andy Fragen
    Moderator

    I think what you may need is a list for the conditional tags. It was compiled by Jonah.
    https://gist.github.com/2415009
    Is that it?

    #22457
    Christian
    Participant

    hy Andy, yepp thats it 🙂
    Thank You!
    @TEC Guys: put that into the Support Section..

    #22633
    Rob
    Member

    Thanks for the assist, Andy!

    Christian: solid suggestion. That should definitely be in there and we’ll work it in accordingly. Looks like you’re all set here but let us know if you need anything else.

    #977404
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘ID & Slug?’ is closed to new replies.