Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Justin,

    Thanks for the updates including the issue of template files only being overridden from template theme and not child theme. Also thanks for adding support for overriding events.css. Unfortunately this new code also does not support child themes.

    Please adjust your code so that it will also look in the stylesheet folder for custom events.css.

    if( file_exists( STYLESHEETPATH.'/events/events.css' ) ) {...

    Thread Starter drewmisterh

    (@drewmisterh)

    @gmiddleb I suppose that would work. Is that really standard practice though? I don’t know. I am new to WordPress. I didn’t want to mess things up. I chose instead to modify the plugin to load the events.css from the stylesheet directory. My hope is that this change will be incorporated into the next update of the plugin since it is consistent with how the author intends for the plugin to be customized.

    Thread Starter drewmisterh

    (@drewmisterh)

    @lyricalbiz – Yes I am using the BuddyPress plugin. And yes one of my issues with the Events Calendar plugin is things not fitting in the space I have. I commented on this in a follow-up thread. (https://www.ads-software.com/support/topic/400120) I am hopeful that the developer will add logic to the plugin to allow me to apply my own CSS to all the plugin elements.

    Thread Starter drewmisterh

    (@drewmisterh)

    The problem with overriding the css rules in events.css is that events.css loads after the theme css and therefore takes presidence. I would prefer not to make changes to the plugin if I can avoid it. Can you adjust the plugin so that it looks for an events.css in the theme or stylesheet directory similar to the template-choosing fix?

    Thread Starter drewmisterh

    (@drewmisterh)

    I made a change to the main plugin php file (the-events-calendar.php) to solve my problem. In the templateChooser function I added an additional conditional for each template type so that it looks like this.

    public function templateChooser() {
    			$this->constructDaysOfWeek();
    			if( !is_feed() ) {
    				// list view
    				if ( $this->in_event_category() && ( events_displaying_upcoming() || events_displaying_past() ) ) {
    					if (file_exists(STYLESHEETPATH.'/events/list.php') ) {
    						include (STYLESHEETPATH.'/events/list.php');
    					}
    					elseif (file_exists(TEMPLATEPATH.'/events/list.php') ) {
    						include (TEMPLATEPATH.'/events/list.php');
    					}
    					else {
    						include dirname( __FILE__ ) . '/views/list.php';
    					}
    					exit;
    				}
    
    				// grid view
    				if ( $this->in_event_category() ) {
    					if (file_exists(STYLESHEETPATH.'/events/gridview.php') ) {
    						include (STYLESHEETPATH.'/events/gridview.php');
    					}
    					elseif (file_exists(TEMPLATEPATH.'/events/gridview.php') ) {
    						include (TEMPLATEPATH.'/events/gridview.php');
    					}
    					else {
    						include dirname( __FILE__ ) . '/views/gridview.php';
    					}
    					exit;
    				}
    
    				// single event
    				if (is_single() && in_category( $this->eventCategory() ) ) {
    					if (file_exists(STYLESHEETPATH.'/events/single.php') ) {
    						include (STYLESHEETPATH.'/events/single.php');
    					}
    					elseif (file_exists(TEMPLATEPATH.'/events/single.php') ) {
    						include (TEMPLATEPATH.'/events/single.php');
    					}
    					else {
    						include trailingslashit( WP_PLUGIN_DIR ) . trailingslashit( plugin_basename( dirname( __FILE__ ) ) ) . 'views/single.php';
    					}
    					exit;
    				}
    			} // if is_feed()
    		}

    This will take ChildThemes into account as far as I can tell. There may be more that needs to be done but that is the first step. I hope this change can be reflected in the next update.

    Thread Starter drewmisterh

    (@drewmisterh)

Viewing 6 replies - 1 through 6 (of 6 total)