Custom Single Evenst Page

Home Forums Calendar Products Events Calendar PRO Custom Single Evenst Page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #937727
    joecalibre
    Participant

    Hi. We’re running WordPress 4.1 and The Events Calendar 3.6.1 and The Events Calendar Pro 3.6.1.

    I know those 2 plugins are a little outdated. But they were significantly hacked in order to deliver content according to very specific requirement documents.

    I’ve encountered a new challenge. We need a custom single events page. Yes, I understand we should grab this file: plugins/the-events-calendar/views/single-event.php and copy it here: themes/[our-theme]/tribe-events/single-event.php and make changes to that file. And we have done that.

    BUT:

    Even when we create a custom file as a template for single-events, however, the page still loads CSS (and maybe JS files) that we don’t need or want. In other words, we want a custom template at tribe-events/single-event.php and we have that. But we DON’T want custom events CSS (and JS files?) that are being loaded somehow but not with single-event.php. How do I turn off these includes? Where are they hiding? Files like tribe-events-full.min.css and tribe-events-calendar-pro-full-mobile-min.css. It is not just a matter of clarity and brevity. Some events CSS files are interrupting the way our page should look and function.

    For example, we have a single-event page with a custom single-event.php file here: http://www.limegrove.com/events/live-limegrove-jj-poulter-4/. But something – one of these CSS files, I think – is interrupting the way our top menu should work.

    Brevity. We have created a custom file our_theme/tribe-events/single-event.php. But the page still loads extra event calendar CSS files that we don’t want. How do we stop that template file from loading extra event calendar CSS files?

    Thank you for your insight.

    #937780
    Brian
    Member

    Hi,

    I can help you out here, but unable to provide much support for older versions.

    Have you tried changed to the Skeleton Stylesheet?

    Go to your site’s admin then:

    Events > Settings > Display Tab

    Change this setting “Default stylesheet used for events templates” to Skeleton Stylesheet to remove most of the styling from the plugin.

    If you have want to remove styling on the single events then you could use WordPress’s wp_dequeue_style to remove the stylesheets on singular tribe_events

    http://codex.wordpress.org/Function_Reference/wp_dequeue_style

    Let me know if you have any follow up questions.

    Thanks

    #937885
    joecalibre
    Participant

    Hi. Yes, in Events > Settings > Display Tab, we do have the Skeleton Stylesheet selected.

    It sounds like the plan to dequeue the css scripts is the right way to play it. As far as I can tell, stylesheets are registered and enqueued in plugins/the-events-calendar/lib/tribe-template-factory.class.php.

    So my process would be, in my theme folder, I have a generic functions.php file, I could dequeue the extra css scripts there with something like the following code:

    // DO NOT ADD SCRIPTS FOR SINGLE EVENT PAGES
    add_action(‘wp_print_scripts’,’dequeue_scripts’);
    function dequeue_scripts() {
    wp_dequeue_script( ‘script_handler_1’ ); // use handler name
    wp_dequeue_script( ‘script_handler_2’ );
    }

    But that leaves me with 2 challenges, still.

    1. I don’t know the names of the css stylesheet handlers. Although I suppose I can find most of them in the class.php file that I indicated.
    2. I suppose we want to use the stylesheets for OTHER event pages; so how do I dequeue these scripts ONLY for Single Events? I don’t quite know how to sort out that logic?

    Thanks again for your attention and insight.

    #938044
    Brian
    Member

    To find out the Scripts and StyleSheets and their handlers on a page. I would recommend using the Query Monitor Plugin.

    It can provide you a complete list in the WordPress toolbar for that page so you can see exactly what you are looking for.

    It is what I use all the time.

    To dequeue on a single events only you can use the singular conditional:

    is_singular( ‘tribe_events’ )

    You can read more about conditionals here:

    http://codex.wordpress.org/Conditional_Tags

    #947403
    Brian
    Member

    Since there is has not been any activity on this thread for over 2 weeks so I am now closing it. Feel free to start a new thread if you have further issues. Thanks! 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Custom Single Evenst Page’ is closed to new replies.