Home › Forums › Calendar Products › Events Calendar PRO › ID & Slug?
- This topic has 11 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
July 17, 2012 at 1:53 am #22189
Christian
ParticipantHey 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 ChrischanJuly 17, 2012 at 7:58 am #22203Andy Fragen
ModeratorChristian, 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;
}
July 18, 2012 at 12:04 am #22250Christian
ParticipantThank 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 <<- SubcategoryThx, so long. Christian
July 18, 2012 at 12:06 am #22251Christian
ParticipantJuly 18, 2012 at 12:08 am #22252Christian
Participantargh.. how can i embed code?
if ( is_category( slug or id ) ) {
// add cc class
}July 18, 2012 at 7:18 am #22259Andy Fragen
ModeratorSorry Christian. It might be easier to start with what you are trying to accomplish.
July 18, 2012 at 7:29 am #22265Andy Fragen
ModeratorThere 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.
July 19, 2012 at 12:52 am #22354Christian
ParticipantHy Andy, thanks for your trys but i think you dont understand what i need?
check this: http://codex.wordpress.org/Conditional_TagsThere 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 ChristianJuly 19, 2012 at 7:25 am #22367Andy Fragen
ModeratorI 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?July 20, 2012 at 5:26 am #22457Christian
Participanthy Andy, yepp thats it 🙂
Thank You!
@TEC Guys: put that into the Support Section..July 24, 2012 at 10:53 am #22633Rob
MemberThanks 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.
July 7, 2015 at 6:25 am #977404Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘ID & Slug?’ is closed to new replies.
