Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6058431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:35:55+00:00 2026-05-23T08:35:55+00:00

I am creating new shortcodes for WordPress on my local version of a WordPress

  • 0

I am creating new shortcodes for WordPress on my local version of a WordPress website.

In functions.php, I am adding for example:

function shortTest() {  
    return 'Test for shortcodes ';  
} 

add_shortcode('shortTestHTML', 'shortTest');  

Adding the function only is OK, but when I add the add_shortcode() portion, I get a major issue.

It breaks something somehow and I get 500 errors, meaning I can’t even load my website locally anymore.

Any thoughts???

Thanks so much!

EDIT:

From PHP Error Log:
[21-Jun-2011 19:02:37] PHP Fatal error: Call to undefined function add_shortcode() in /Users/jonas/Sites/jll/wp-includes/functions.php on line 4505

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:35:56+00:00Added an answer on May 23, 2026 at 8:35 am

    1) Make sure that you have included shortcodes.php file somewhere (for example, in wp-load.php or whatever other more appropriate place may be).

    require_once( ABSPATH . '/wp-includes/shortcodes.php' );
    

    2) Make sure that this file does exist on your installation (which I think you have otherwise we would see a different error).

    3) Where do you call this function from (I see it is called from functions.php, but which place)? Possible problem here — functions.php is loaded prior to shortcodes.php, and if you do use that add_shortcode function before shortcodes.php is loaded you most likely will see this error. Double check your code in that place — maybe move the call to add_shortcode to another place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i modify returning value of built-in php function without creating new function
I have 2 custom fields in my WordPress system when creating new posts. One
I seem to be having a problem creating new local variables inside a switch
In most examples I saw the incoming data (for example for creating new entity)
I'm preparing for performance tests and creating new test cases. So I was just
I have the below function creating new panels inside my ViewStack.. This works fine
When I was programming a Form Validator in PHP, when creating new methods, I
I'm creating new events in a google calendar ( php API ) and I
I'm creating new select boxes from a javascript function, on a div click event.
I'm using the jqueryui tabs code, adding new tabs, and dynamically creating new content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.