Home › Forums › Calendar Products › Events Calendar PRO › Customizing the Tribe Events Bar
- This topic has 4 replies, 4 voices, and was last updated 7 years, 5 months ago by Mogul.
-
AuthorPosts
-
November 16, 2016 at 12:09 am #1193007MogulParticipant
I have added an additional filter to the bar, with a dropdown of the event categories using this code:
add_filter( 'tribe-events-bar-filters', 'setup_my_field_in_bar', 1, 1 );
function setup_my_field_in_bar( $filters ) {
$filters['tribe-bar-department-filter'] = array(
'name' => 'tribe-bar-department',
'caption' => 'Department',
'html' => '<select onchange="if (this.value) window.location.href=this.value">
<option value="/auctions/">DEPARTMENT</option>
<option value="/auctions/category/twentieth-century-design/"> 20th Century Design</option>
<option value="/auctions/category/modern-post-war-art/"> Modern & Post-War Art</option>
<option value="/auctions/category/chinese-japanese-islamic-art/"> Chinese, Japanese & Islamic Art</option>
<option value="/auctions/category/jewellery-watches/"> Jewellery & Watches</option>
<option value="/auctions/category/rugs-tribal-art"> Rugs & Tribal Art</option>
<option value="/auctions/category/furnature-garden-house-sales"> Furniture, Garden & House Sales</option>
<option value="/auctions/category/traditional-paintings-watercolours-prints"> Traditional Paintings, Watercolours & Prints</option>
<option value="/auctions/category/clocks-barometers"> Clocks & Barometers</option>
<option value="/auctions/category/silver"> Silver</option>
<option value="/auctions/category/british-european-ceramics-glass"> British & European Ceramics & Glass</option>
<option value="/auctions/category/books-manuscripts"> Books & Manuscripts</option>
<option value="/auctions/category/medals-militaria-vintage-toys"> Medals, Militaria & Vintage Toy</option> </select>'
);return $filters;
}Now i want to add another dropdown of some other event categories in place of the Near section.
I have tried this code:
add_filter( 'tribe-events-bar-filters', 'setup_my_location_in_bar', 1, 1 );
function setup_my_location_in_bar( $filters ) {
$filters['tribe-bar-department-filter'] = array(
'name' => 'tribe-bar-location',
'caption' => 'Location',
'html' => '<select onchange="if (this.value) window.location.href=this.value">
<option value="/auctions/">Location</option>
<option value="/auctions/category/oxford/"> Oxford</option>
<option value="/auctions/category/cheltenham/"> Cheltenham</option>
<option value="/auctions/category/abingdon/"> Abingdon</option> </select>'
);return $filters;
}But this causes errors, any ideas??
thanks
November 16, 2016 at 4:01 am #1193055MogulParticipantAnyone?
November 16, 2016 at 11:42 am #1193391CliffMemberHi, Mogul.
Please understand that we answer threads in the order we receive the initial message and bumping a thread won’t increase our response time. Additionally, we aim for our response time to be within 24 hours. This response is about 8 hours after your initial post.
Regarding your request, I believe I understand what you’re asking for, but we’re limited in helping with customizations, per our Scope of Support / Terms. However, I can try to help point you in the right direction.
tribe-events-bar-filters is the correct filter to do what you’re wanting. In fact, PRO uses that filter to implement its setup_geoloc_filter_in_bar function in this file: /wp-content/plugins/events-calendar-pro/src/Tribe/Geo_Loc.php
You might want to change your filter’s priority (negative numbers work too) or adjust the $filters array to re-order them into the order you desire.
Finally, just as an FYI, we also sell the Filter Bar add-on that enables filtering by Event Category, Venue city names, PRO’s additional fields, and more. It also has a 30 day refund policy so you can buy one or many of our add-ons and thoroughly test them.
Let me know if you have any follow-up questions.
December 8, 2016 at 8:35 am #1203162Support 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 ‘Customizing the Tribe Events Bar’ is closed to new replies.