WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Category Slug (4 posts)

  1. YEUStudent
    Member
    Posted 1 year ago #

    Is there a way to get the category slug like:
    #_CATEGORYSLUG

    It would be very useful to me!

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

    please see this docs

    -http://codex.wordpress.org/Taxonomies
    -http://codex.wordpress.org/Function_Reference/get_term

    then you can create your own placeholder - http://wp-events-plugin.com/tutorials/create-a-custom-placeholder-for-event-formatting/

  3. marsbidon
    Member
    Posted 1 year ago #

    I also needed of this and I've found to solution, so I post it for those who want to know much :

    add_filter('em_event_output_placeholder','my_em_styles_placeholders',1,3);
    function my_em_styles_placeholders($replace, $EM_Event, $result){
    	global $wp_query, $wp_rewrite;
    
    	switch( $result ){
    		case '#_CATEGORYSLUG':
    			$replace = 'none';
    			$event_category_id = $EM_Event->get_categories()->get_ids();
    			$event_category_slug = $EM_Event->get_categories()->categories[$event_category_id[0]]->slug;
    
    			$replace = $event_category_slug;
    
    			break;
    	}
    	return $replace;
    }
  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    thx for sharing!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic