• Resolved trillf

    (@trillf)


    Hi! I want to add specific events to the events_list short code displaying, is it possible? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,
    EM User here ??

    Wouldn’t it be easier to assign those events to an event category? That way you will keep the benefits of the scope (future) and you won’t have to manually change the events_list shortcode every time you add or remove an event.

    Then the shortcode would be something like:
    [events_list category=”88″] showing only the events in that category.

    Else, you could try something like:
    [events_list post_id=”10,23,564″]

    Patrick, I tried to do this on custom categories (standard WP category and a custom category), but this did not work. It only seems to work with event categories. Is that correct?

    Tammo

    Hey Tammo ??
    Yes, Event categories are completely separate from blog categories. Events Manager only works (in shortcodes etc) with Events Categories.

    If you want to enable blog categories in your events (for easier use within WP_Query, for example), you need this snippet:

    function stonehenge_use_blog_categories_in_em() {
    	$supported_array = (EM_MS_GLOBAL && !is_main_site()) ? array() : array(EM_POST_TYPE_EVENT,'event-recurring');
    	register_taxonomy_for_object_type('category',EM_POST_TYPE_EVENT);
    	register_taxonomy_for_object_type('category','event-recurring');
    	// register_taxonomy_for_object_type('category',EM_POST_TYPE_LOCATION);
    }
    add_action('init', 'stonehenge_use_blog_categories_in_em', 100);

    Please note that the Dutch translation results in “Categori?n” for both types ?? That is because in the EM .po file “Events Categories” is translated as “Categori?n”.

    So for that, you’ll need this snippet”

    // Rename Blog Category (translated wrongly in Events Manager)
    function stonehenge_rename_blog_category() {
    	global $wp_taxonomies;
    	$cat = $wp_taxonomies['category'];
    	$cat->label = __('Blog Categories', 'your-theme-textdomain');
    	$cat->labels->singular_name = __('Blog Category', 'your-theme-textdomain');
    	$cat->labels->name = $cat->label;
    	$cat->labels->menu_name = $cat->label;
    }
    add_action( 'init', 'stonehenge_rename_blog_category');
    Thread Starter trillf

    (@trillf)

    Hi! Thanks for your replies, I tried another method to get specific events, using the Event class you built (and with the function output), with that it’s easier to display any event with correct format, thanks for that!
    Actually my client wanted to list event with most viewed (hits), so I developed a function to count hits (storing hit info in separated table).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘events_list with selected event ids ?’ is closed to new replies.