Changing the word events snippet causing fatal error

Home Forums Calendar Products Events Calendar PRO Changing the word events snippet causing fatal error

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #810459
    Pat Donegan
    Participant

    Hi Guys,
    I’m trying to use the snippet of code suggested here:
    https://theeventscalendar.com/support/documentation/changing-the-word-events-to-something-else/

    to change the word ‘Events’ to ‘Courses’. I’m using Pagelines DMS 2.1.7 and iBlogPro6 V 1.2.
    When I add the snippet to the function.php file I get the following error.

    Fatal error: Call to undefined function add_filter() in /home/noelgrou/public_html/wp-includes/functions.php on line 4639

    As soon as I remove the snippet and re-save the file, all is well again.
    I’ve added the snippet to the very end of the functions.php file, after the last }.
    Perhaps there is somewhere else I need to place it? Any advice on this would be very much appreciated.
    Thanks a mil.
    Gav.

    #810514
    Geoff
    Member

    Hi there, Gavin! Sorry you’re hitting some trouble here, but let’s see if we get figure it out here together.

    It’s very possible it just needs to be placed somewhere else in your functions.php file or the syntax needs to be checked. I just added the snippet to the very bottom of my own file and it worked well.

    Some other things to check:

    • Is there a closing PHP tag before the snippet? If so, you’ll want to paste the snippet before that, or add new opening/closing PHP tags around the snippet.
    • <span style=”line-height: 13px;”>Are there blank lines at the end of the file? That can sometimes cause issues.</span>
    • Are there an stray spaces, commas or semicolons?

    Give those a try and keep me posted with what you find. 🙂

    Cheers!
    Geoff

    #811038
    Pat Donegan
    Participant

    Hi Geoff,

    Thank you so much for the helpful suggestions. I was adding this to the functions.php file through cpanel. However, when I attempted to do it through the wordpress editor – it worked a treat! Sorry for the hassle. It might be worth popping this into the document for anyone else who hits the same speed bump. I think in my case it was to do with the active child theme and I may have been adding it to the core functions php file..? Either way, by adding it to the functions.php file available in the wordpress editor, the snippet worked perfectly.

    Thanks once again for your help!
    Gav.

    #812357
    Geoff
    Member

    No hassle at all! I’m so glad this worked out and everything is working. 🙂

    I’m going to go ahead and close this thread, but please feel free to hit us up with a new thread if any other questions pop up. We’d be happy to help!

    Cheers,
    Geoff

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Changing the word events snippet causing fatal error’ is closed to new replies.