WordPress.org

Ready to get started?Download WordPress

Forums

Fatal Error (4 posts)

  1. maxamobile
    Member
    Posted 3 years ago #

    Hi, I'm new to WordPress and am working on a site for a client.

    I purchased this theme from one of the sites, and the designer is unavailable for 2 weeks, so I'm hoping someone can help me here.
    Everything was going well until I tried to add a URL to a shortcode in shortcode.php. I put the code back to what it was originally, and now I get this error and can't access the dashboard or any pages:
    Fatal error: Call to undefined function add_shortcode() in /home/content/p/a/t/pattonpr/html/wp-includes/shortcodes.php on line 15

    I did nothing to line 15 in this code. I've tried to re-upload the original shortcode.php file. Still no change.

    What I was trying to do as Plan B is find the HTML code on the page to remove the shortcode button. I thought this might solve the problem and be the easiest work around to get the site back up. Any suggestions? Thanks so much in advance.

  2. Ganners
    Member
    Posted 3 years ago #

    Put up your php file in http://pastebin.com/, It says that your function is missing, so perhaps the function name is wrong, you're missing an include, or the function just got deleted somewhere in the process.

    Also it's generally not a good idea to edit the core wordpress files, they'll get overwritten in updates etc. You can hook using the add_shortcode function in your theme functions for example.

  3. maxamobile
    Member
    Posted 3 years ago #

    Thanks, Ganners. I put the code on the site. Not sure protocol for sharing with you, but here's the link: http://pastebin.com/Nu9gE55a
    It's called WP_3_6

    I assumed editing those files was a bad idea, but the instructions that came with the template were not that clear to a newbie. :-(

    Thanks so much!

  4. Ganners
    Member
    Posted 3 years ago #

    Ah okay, I think what you've done is replaced the wordpress shortcodes.php with your themes file.

    So what i'd recommend is getting your shortcodes.php back to normal, so download wordpress again and just copy that file over it.

    The file you pasted should be part of your theme and so not in wp-includes/ but in wp-content/your_theme/ which may have been where you went wrong (perhaps they're both named shortcodes.php).

Topic Closed

This topic has been closed to new replies.

About this Topic