Hiding the iCal import bar on the events page

Home Forums Calendar Products Events Calendar PRO Hiding the iCal import bar on the events page

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #75606
    lisadavies
    Participant

    Hi, asked last month about hiding the iCal import bar on the events page and you helped me to resolve it. However, updating the plugin has meant that it’s now re-appearing (not on the current month page) on the previous and next month’s pages? Can you let me know why that is happening and how I can resolve it?

    Thanks

    #75887
    Barry
    Member

    Hi lisadavies: can you confirm if the snippet is still present in your theme’s functions.php file? Best I can tell it should still work as expected, so one possibility is that you also updated your theme and your functions.php file was overwritten (in which case, you could either set this code up as a plugin or make the change from within a child theme – or otherwise follow your theme vendor’s instructions for adding custom code instead).

    Does that help at all?

    #76170
    lisadavies
    Participant

    Hi, thanks for the reply. I confirm that the snippet is still present in my theme’s functions.php file (see below excerpt extracted from the file). I can also confirm that I did not update the theme nor the child theme. I believe I only updated the relevant plugins including the Event calendar and the catergory colours etc. Does this help?

    Thanks

    <?php //
    add_action('tribe_events_before_template', 'remove_ical_from_list_view');

    function remove_ical_from_list_view() {
    if (tribe_is_event_query() && tribe_is_list_view())
    remove_filter('tribe_events_after_footer', array('TribeiCal', 'maybe_add_link'), 10, 1);
    }

    add_action('tribe_events_before_template', 'remove_ical_from_month_view');

    function remove_ical_from_month_view() {
    if (tribe_is_event_query() && tribe_is_month())
    remove_filter('tribe_events_after_footer', array('TribeiCal', 'maybe_add_link'), 10, 1);
    }

    #76226
    Barry
    Member

    That does help, I had actually thought you were referring to this code as provided in your previous post, but you are clearly using quite different code, hence the confusion ๐Ÿ™‚

    The code you are using does still work for me, however, so I can’t help but think there is some other issue here. Can you post the complete contents of your theme’s functions.php file so I can see that snippet in context? Can you also do so using a service such as Pastebin or Gist, rather than posting directly in the forum, to avoid code being dropped (our forum software does not currently do a great job in terms of handling code).

    Thanks!

    #76387
    lisadavies
    Participant

    Hi, thanks for the reply. Not used Gist or Pastebin before so was confused with it but think I’ve done it. I’m not sure how I should share the link to show you the code but think this is it: http://pastebin.com/TuP3wJCu. Hope you are able to access. Let me know if otherwise.

    Thanks

    #76577
    Barry
    Member

    Hi lisadavies,

    It looks fine to me, I’m not sure why it isn’t working for you: if I test the very same code, literally copying and pasting from your version, it works perfectly. Is it at all possible you are editing the wrong functions.php file?

    In any case, I’m afraid we’re not going to be able to help much more with this since it still seems like a basically sound approach when I test it out and is also a customization, for which we can really only provide pointers.

    If it helps we can give you a list of freelancers/independent developers who might be able to guide you through this and figure out what might be going wrong in the specific case of your installation?

    #76592
    lisadavies
    Participant

    Hi, thanks for the reply. I’ve had another look and realise why I thought it worked before and it doesn’t now. When I was testing it the last time, the import bar didn’t appear at all but I think that was because there were no events in the calendar so it seems to appear only when there are events in the calendar. Is that right and is that supposed to work like that?

    It’s not a big problem so it’s fine if it can’t be resolved. I just think it’s a bit strange for people to import the calendar in the previous month if they have already happened – do you know what I mean?

    Anyway, thanks for all your help with this!

    #76593
    lisadavies
    Participant

    Can I just double check with you that we are on the same wavelength? The import bar does not appear on the current month which is what I wanted. However, the import bar appears on the previous and next months which is what I didn’t want but like I said, it’s not a big problem if it can’t be resolved.

    Thanks!

    #76684
    Barry
    Member

    Ahh, I see. No we weren’t quite on the same wavelength but you’re right, that is an issue and one I believe we had on our issue tracker. Bear with me while I check in on the progress of that.

    #76685
    Barry
    Member

    OK, so a number of changes were made and we actually ought to take a different tact here. So, remove that code you currently have and – if you want to remove iCal buttons everywhere – add this instead:

    add_filter('tribe_events_list_show_ical_link', '__return_false');

    If you want to target only month and list view, try this snippet instead of the above one. Does that help?

    #77793
    lisadavies
    Participant

    Morning! I couldn’t log in the other day so couldn’t reply. Just wanted to say that your advice above worked. It’s looking fab now, so once again thank you!

    #77810
    Kelly
    Participant

    Thatโ€™s great news, lisadavies! ๐Ÿ™‚ Thanks for letting us know!

    #982271
    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 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Hiding the iCal import bar on the events page’ is closed to new replies.