Home › Forums › Calendar Products › Events Calendar PRO › Map page Categories remove issue
- This topic has 8 replies, 4 voices, and was last updated 7 years, 3 months ago by Mark Metz.
-
AuthorPosts
-
December 3, 2016 at 12:28 am #1201142Mark MetzParticipant
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 thanksDecember 5, 2016 at 4:56 am #1201483NicoMemberHi 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,
NicoDecember 7, 2016 at 4:21 am #1202533Mark MetzParticipantGreat 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
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 thanksDecember 8, 2016 at 12:24 pm #1203409NicoMemberGlad 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,
NicoDecember 9, 2016 at 3:25 am #1203745Mark MetzParticipantcan you provide full of code like example thanks
December 10, 2016 at 12:44 am #1204320Mark MetzParticipantor do you have member list with profile its events page someting like that or that page shortcode?
December 12, 2016 at 7:33 am #1204703NicoMemberHey 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 = '
- ';
- ' . $post->post_title . ' - ' . tribe_get_start_date( $post ) . '
foreach ( $events as $post ) {
setup_postdata( $post );$return_events .= '
';
}$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,
NicoJanuary 3, 2017 at 8:35 am #1212565Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Map page Categories remove issue’ is closed to new replies.