Map page Categories remove issue

Home Forums Calendar Products Events Calendar PRO Map page Categories remove issue

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1201142
    Mark Metz
    Participant

    Hi
    i want to remove sapacfic Categories from map page so its hard for me after that i can do that from code and eculded Categories from map page.from this code
    /*
    * The Events Calendar Remove Events from Month and List Views
    * add coding to theme’s functions.php
    * @version 3.12
    * modify here with event category slugs: array( ‘concert’, ‘convention’ )
    */
    add_action( ‘pre_get_posts’, ‘tribe_exclude_events_category_map_list’ );
    function tribe_exclude_events_category_map_list( $query ) {

    if ( isset( $query->query_vars[‘eventDisplay’] ) && ! is_singular( ‘tribe_events’ ) ) {

    if ( $query->query_vars[‘eventDisplay’] == ‘list’ && ! is_tax( Tribe__Events__Main::TAXONOMY ) || $query->query_vars[‘eventDisplay’] == ‘map’ && $query->query_vars[‘post_type’] == Tribe__Events__Main::POSTTYPE && ! is_tax( Tribe__Events__Main::TAXONOMY ) && empty( $query->query_vars[‘suppress_filters’] ) ) {

    $query->set( ‘tax_query’, array(

    array(
    ‘taxonomy’ => Tribe__Events__Main::TAXONOMY,
    ‘field’ => ‘slug’,
    ‘terms’ => array( ‘community-dances’,’repeating-classes’ ),
    ‘operator’ => ‘NOT IN’
    )
    ) );
    }

    }

    return $query;
    }
    ok now i have a problem its also exculded catgries from map pin i want still notshowing these catagries on map page but show on map pin can you help me pls thanks

    #1201483
    Nico
    Member

    Hi there Mark,

    Thanks for getting in touch with us!

    I’ve been inspecting the code you send, the plugin source that generates the markers and the event list shown below the map. I discovered it’s the same query that fetches the posts for the list and then from that results the map pins are generated. Unfortunately this means it’s no possible to do this easily 🙁

    As a workaround you might want to hide those events by using CSS, with some code like:

    /* Change 'sports' to your category slug */
    .tribe-events-map .tribe-events-category-sports{
    display: none;
    }

    Please let me know if this helps,
    Best,
    Nico

    #1202533
    Mark Metz
    Participant

    Great its working now
    i want one more issue can you help me please here is my user and i am using third party plugin upme for profile and Register ete here

    zzz


    you can see there is user post dummy post and its show like 1 ENTRY0 COMMENTS and below its post
    but this user also post event and i want to show its user event also
    can you give me any php code or something else we call a funcation and show user post events then i can add into code
    i just a code where to call user event show his events or something elase member list thanks

    #1203409
    Nico
    Member

    Glad to hear Mark!

    Regarding your new question, you can use the tribe_get_events function (Using tribe_get_events). Make sure you add an author parameter with the corresponding user ID.

    Please let me know if you can make it work or need further help on this,
    Best,
    Nico

    #1203745
    Mark Metz
    Participant

    can you provide full of code like example thanks

    #1204320
    Mark Metz
    Participant

    or do you have member list with profile its events page someting like that or that page shortcode?

    #1204703
    Nico
    Member

    Hey Mark,

    Add this codes to your theme’s (or child theme’s) functions.php file and use the shortcode [tribe_user_events] to display the current user events list:

    /* Tribe, shortcode to display user events [tribe_user_events] */
    function tribe_do_user_events ( $atts ) {

    if ( $user_id = get_current_user_id() && function_exists('tribe_get_events') ) {

    $events = tribe_get_events( array(
    'author' => $user_id,
    'posts_per_page' => -1,
    'start_date' => date( '2000-01-01' ) // get all events!
    ) );

    if ( empty ($events) ) return 'No events for this user';

    $return_events = '

      ';

      foreach ( $events as $post ) {
      setup_postdata( $post );

      $return_events .= '

    • ' . $post->post_title . ' - ' . tribe_get_start_date( $post ) . '
    • ';
      }

      $return_events .= '

    ';

    return $return_events;
    }

    }
    add_shortcode( 'tribe_user_events', 'tribe_do_user_events' );

    Please let me know if this works for you, I’m afraid I cannot help much more as this is a customization particular to your project,
    Best,
    Nico

    #1212565
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Map page Categories remove issue’ is closed to new replies.