Mini Calendar – default display month as that of next upcoming event

Home Forums Calendar Products Events Calendar PRO Mini Calendar – default display month as that of next upcoming event

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #59385
    Graeme
    Participant

    P.S. I should mention that I’m using a child theme, and so have placed this in the child themes functions.php – it shouldn’t make a difference, but just thought I’d mention it.

    #59390
    Graeme
    Participant

    P.P.S. I also got it working to a target month via passing $target_date through to the Tribe_Advance_Minical() function – it worked perfectly. Thought you might like to know as this is a good idea too.

    #59409
    Barry
    Member

    Great – thanks for the feedback Graeme.

    I also got it working to a target month via passing $target_date through to the Tribe_Advance_Minical() function – it worked perfectly.

    Yep that was the idea – you can set a specific month or else let it find the date of the next upcoming event date, if there is one (or it will default to the current month and year).

    I should mention that I’m using a child theme, and so have placed this in the child themes functions.php

    That shouldn’t cause any problems and is a good way to do things. Often you’ll find us saying people should add a piece of code to functions.php simply because so many users are comfortable doing this and have done it before, but doing it within a child theme (or in some cases a new plugin) is often the best path.

    However, the list of events that appears below the calendar is not updating – it appears blank until I click the day of the month that contains an event, then it appears.

    Good catch, let me check on that one.

    #59418
    Barry
    Member

    OK, still doesn’t have all the characteristics you might be after but this version could get you closer: http://pastebin.com/h0Fw6YXi

    #59454
    Graeme
    Participant

    Spot on Barry, works a treat – does exact what I need.

    Thanks a lot for your help.

    #59466
    manelequinocci
    Participant

    One of you, do you mind telling me whereabout I have to insert the code in my theme’s function file, please? Thanks a lot!

    #59467
    manelequinocci
    Participant

    Graeme, Barry… I’ve just solved my problem. I had to put your code at the very beginning of my function.php file.

    It’s working perfectly… have a look if you wish: http://www.equinocci.com/diario-blog/

    Cheers!

    #59468
    Graeme
    Participant

    functions.php is generally in the root of your theme, not the plugin e.g.
    wp-content/themes/[theme name]/functions.php

    Just place the code Barry link above in the functions.php file anywhere between the opening and closing php tags.


    If you are going to start editing your theme’s files, I suggest you use a child them – which is super simple to create, see this: http://codex.wordpress.org/Child_Themes. You can then create a new functions.php in the child theme folder and edit it. This will ensure any changes are not overwritten when you update your theme.

    Note: a child theme functions.php is IN ADDITION to the parent theme functions.php, so no need to copy the contents of the parent functions.php – just create a new one.

    #59469
    manelequinocci
    Participant

    Thanks a lot for your recommendations, Graeme. Will have a look asap. Cheers.

    #59503
    Barry
    Member

    Thanks both, glad it’s working for you.

    Graeme’s notes on child themeing are definitely solid points – don’t be misled by the fact that we so often tell people to drop code into functions.php – there are often better ways to do it, we’re basically just offering the most commonly-understood path.

    In any event since it looks like we’re all good here I will close this thread.

    Thanks!

    #979800
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 11 posts - 16 through 26 (of 26 total)
  • The topic ‘Mini Calendar – default display month as that of next upcoming event’ is closed to new replies.