Forum Replies Created
-
AuthorPosts
-
October 1, 2018 at 1:56 am in reply to: Error in the admin : Warning: sprintf(): Too few arguments #1634241deodatParticipant
Hi Jeremy,
well the error vanished 🙂
Anyway, thanks for your help,
Cheers,
David
deodatParticipantSky,
You put me on the road.
This actually works for me :
In functions.php :
remove_action( 'wp_enqueue_scripts', array( Tribe__Events__Filterbar__View::instance(), 'enqueueStylesAndScripts' ), 11 );
and in the modified and copied title-bar.php template :
<?php tribe_get_template_part( 'filter-bar/filter-view-horizontal' ); ?>
easy peasy 🙂
Thanks a lot,
David
deodatParticipantThis reply is private.
deodatParticipantHi Sky,
I’m sorry but I’m confused here because, for me, this template part is not for the filter bar but for the Events Navigation Bar (located here : /the-events-calendar/src/views/modules/bar.php).
I can’t find something similar in The Events Calendar Filterbar plugin.
The only chunk of code where I can move this filter bar is the one I indicated earlier :
the-events-calendar-filterbar/src/Tribe/View.php
if ( $show_filter ) { // Only display filters before template if the layout is horizontal if ( tribe_get_option( 'events_filters_layout', 'vertical' ) == 'vertical' ) { add_action( 'tribe_events_bar_after_template', array( $this, 'displaySidebar' ), 25 ); } else { if ( tribe_get_option( 'tribeDisableTribeBar', false ) == true ) { add_action( 'tribe_events_after_the_title', array( $this, 'displaySidebar' ), 25 ); // MY OVERRIDE } else { add_action( 'tribe_events_bar_after_template', array( $this, 'displaySidebar' ), 25 ); } } }
But it will be great indeed if I could just use a template part.
I give you my credentials in the next private message.
Regards,
David
deodatParticipantwhen I’m adding all the original code of the Tribe__Events__Filterbar__View Class (with just my override), it quite works … but my filter is displayed twice 🙁
I don’t understand why.
deodatParticipantI managed to remove the filter bar like this :
remove_action( 'wp_enqueue_scripts', array( Tribe__Events__Filterbar__View::instance(), 'enqueueStylesAndScripts' ), 11 );
but I can’t manage to add it after that with a custom Class like this :
class MyTheme__Events__Filterbar__View extends Tribe__Events__Filterbar__View { public function enqueueStylesAndScripts() { ... some original code ... $show_filter = apply_filters( 'tribe_events_filters_should_show', in_array( get_post_type(), array( Tribe__Events__Main::VENUE_POST_TYPE, Tribe__Events__Main::ORGANIZER_POST_TYPE ) ) ? false : true ); if ( $show_filter ) { // Only display filters before template if the layout is horizontal if ( tribe_get_option( 'events_filters_layout', 'vertical' ) == 'vertical' ) { add_action( 'tribe_events_bar_after_template', array( $this, 'displaySidebar' ), 25 ); } else { if ( tribe_get_option( 'tribeDisableTribeBar', false ) == true ) { add_action( 'tribe_events_after_the_title', array( $this, 'displaySidebar' ), 25 ); // MY OVERRIDE } else { add_action( 'tribe_events_bar_after_template', array( $this, 'displaySidebar' ), 25 ); } } } ... some original code ... } } add_action( 'wp_enqueue_scripts', array( MyTheme__Events__Filterbar__View::instance(), 'enqueueStylesAndScripts' ), 11 );
deodatParticipantThis reply is private.
deodatParticipantThis reply is private.
deodatParticipantThis reply is private.
-
AuthorPosts