Linking Widget to Main Calendar

Home Forums Calendar Products Events Calendar PRO Linking Widget to Main Calendar

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1148427
    Heather Simon
    Participant

    Is there a way to link the Month/Year in the widget to the main calendar?

    #1148456
    Geoff
    Member

    Hey Heather, happy Friday!

    Yeah, that’s possible. It will take a bit of custom development on your part, but here’s how I would approach it:

    • Make a copy of the following file: /wp-content/plugins/events-calendar-pro/src/views/widgets/mini-calendar/grid.php
    • Make a new folder in your theme directory called tribe-events
    • Make a new folder in that one called pro
    • Make a new folder in that one called widgets
    • Make a new folder in that one called mini-calendar
    • Move the copied grid.php file in that last folder

    Now that the template is in your theme, you can modify it to suit your needs. In this case, change this line:

    <span id="<?php echo esc_attr( $mini_cal_widget_id ) ?>"><?php tribe_events_the_mini_calendar_title() ?></span>

    …to this:

    <span id="<?php echo esc_attr( $mini_cal_widget_id ) ?>">"><?php tribe_events_the_mini_calendar_title() ?></span>

    Will that work for you? Please let me know. 🙂

    Cheers!
    Geoff

    #1149016
    Heather Simon
    Participant

    I think we are on the right track but the code you gave only added a “> in front of the date. Can you recheck the code? Thanks!

    #1149020
    Geoff
    Member

    Oh gosh, so sorry! It looks like the code I pasted got converted into strange characters. Here’s what it should be:

    <span id="<?php echo esc_attr( $mini_cal_widget_id ) ?>"><a href="<?php tribe_get_events_link() ?>"<?php tribe_events_the_mini_calendar_title() ?></a></span>

    Does that work any better? Please let me know.

    Cheers,
    Geoff

    #1149039
    Heather Simon
    Participant

    It still looks like there is an error in the code. The month is not showing up when I put in the revised code. This is highlighted as the error <a href="<?php tribe_get_events_link() ?>"<?php tribe_events_the_mini_calendar_title() ?>

    #1149411
    Geoff
    Member

    Hey Heather, sorry about that — looks like the code formatting isn’t playing nicely in this thread.

    Let’s give this a try in a Gist snippet instead. Here’s what you should be able to use in the template:

    https://gist.github.com/geoffgraham/e1ad770e7d2831a73f90fba26d2d2e86

    Will this do the trick? I sure hope so, but please let me know if it continues to be fussy.

    Thanks!
    Geoff

    #1149437
    Heather Simon
    Participant

    Perfect Geoff. Thank you so much!

    #1149462
    Geoff
    Member

    My pleasure! Sorry for the false starts there, but I’m so glad this finally worked out.

    I’ll go ahead and close this thread but please do feel free to open a new one if any other questions pop up and we’d be more than happy to help. 🙂

    Cheers and have a great day!
    Geoff

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Linking Widget to Main Calendar’ is closed to new replies.