Feature/Header image in Month View, and hiding/customising meta area

Home Forums Calendar Products Events Calendar PRO Feature/Header image in Month View, and hiding/customising meta area

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #932415
    ardcgarage
    Participant

    Hi Tribers,
    I have a couple of questions for you, and I have looked through the guide and forums at length and cant quite find what i want – hoping you can help 🙂

    I have a main image for the calendar landing page in month view, which fits perfectly above the grid. Ive lazily put this in via the Advanced Template Settings (Add HTML before event content). Obviously, this makes it appear everywhere including singe event display. I only want it on the month view. Can you assist with the right way, or a nice bit of code for me?

    Secondly, how much flexibility do we have to modify the meta area with details and organiser etc in single event view? All my factoids are bunched to the left, and I dont really want some things showing up in there such as the event tags. Assuming this can be hidden via php but Im far more comfy with custom css?

    Oh, and PS- thank you for giving me a fix a while ago to let me use your plugin again. I admittedly went to a competitor, but have come back and am very happy with what I can do now 🙂

    #932579
    Barry
    Member

    Hi ardcgarage!

    I have a couple of questions for you, and I have looked through the guide and forums at length and cant quite find what i want – hoping you can help :)

    No problem – but please note we do try to stick to one question per topic, so let’s deal with your first question in here and if you could post a new topic for your other question someone will be only too happy to help.

    I have a main image for the calendar landing page in month view, which fits perfectly above the grid. Ive lazily put this in via the Advanced Template Settings (Add HTML before event content). Obviously, this makes it appear everywhere including singe event display. I only want it on the month view. Can you assist with the right way, or a nice bit of code for me?

    You can make use of a filter hook to selectively add content to just one view (like month view):

    add_filter( 'tribe_events_before_html', 'add_month_view_header_img' );
    
    function add_month_view_header_img( $html ) {
        if ( ! tribe_is_month() ) return $html;
        $html .= '<img src="..." />';
        return $html;
    }

    You could add a snippet like the above – obviously adjusting to correct the image URL – to your theme’s functions.php file, as an example.

    Would that work for you?

    #932844
    ardcgarage
    Participant

    Thanks Barry,
    Didn’t want to spam the forum, Ill start a new topic for the second question. Thanks.
    Re the snippet, I get the white screen of death no matter what I do. Ive added my source for the image, tried it with both “heaader’ and ‘header’ in the code, fiddled a bit, entered via Editor and FTP, and its the white screen no matter what. 🙁
    Theme is Avada?

    #932851
    Barry
    Member

    That’s odd.

    I’ve corrected the typo in my last reply – but even with the misspelling of ‘header’ it should not have triggered a fatal error (and doesn’t for me, whether I use the corrected version or the previous version).

    Can you provide any more details? Where did you add the snippet exactly and (perhaps by turning WP_DEBUG on temporarily) can you provide more complete details as to the error?

    Thanks!

    #932869
    ardcgarage
    Participant

    Hi again,
    Thanks Barry.
    I popped it into the end of functions.php using editor, then used textedit to change it directly into ftp, both causing white screen. Example below of last bit of code in functions.php:

    /**
     * Layerslider API
     */
    function avada_layerslider_ready() {
    	if( class_exists('LS_Sources') ) {
    		LS_Sources::addSkins( get_template_directory().'/framework/ls-skins' );
    	}
    }
    add_action( 'layerslider_ready', 'avada_layerslider_ready' );
    
    /**
     * Calendar page
     */
    add_filter( 'tribe_events_before_html', 'add_month_view_header_img' );
     
    function add_month_view_header_img( $html ) {
        if ( ! tribe_is_month() ) return $html;
        $html .= '<img src="http://ardcbeta.randemgroup.com.au/wp-content/uploads/2013/07/2015_1-web.jpg" />';
        return $html;
    #932904
    Barry
    Member

    So I’m not sure if the forum mangled the code you posted or if you just cut it too short – but it looks like a closing brace } may be missing from the end of that function.

    #932964
    ardcgarage
    Participant

    OF COURSE IT WAS.
    I cant believe I missed it, I’m such a noob.
    Barry, you’re a legend. Thank you so much.
    Samantha x

    #933001
    Barry
    Member

    Happy to help 🙂

    I’ll go ahead and close out this topic – but if anything else crops up please don’t hesitate to create new topics as needed and one of the team will be only too happy to assist.

    Thanks again!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Feature/Header image in Month View, and hiding/customising meta area’ is closed to new replies.