Title: add_shortcode problem!
Last modified: August 19, 2016

---

# add_shortcode problem!

 *  [Cedriking](https://wordpress.org/support/users/cedriking/)
 * (@cedriking)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/add_shortcode-problem/)
 * Hello, im trying to add some shortcodes to my wordpress, but it give me an error
   on any of my scripts, here is one of them:
 *     ```
       function permalink_thingy($atts) {
       	extract(shortcode_atts(array(
       		'id' => 1,
       		'text' => ""  // default value if none supplied
           ), $atts));
   
           if ($text) {
               $url = get_permalink($id);
               return "<a href=".$url." rel='nofollow'>$text</a>";
           } else {
       	   return get_permalink($id);
       	}
   
       }
       add_shortcode('permalink', 'permalink_thingy');
       ```
   
 * I put this on my functions.php i dont know whats the problem.
    The error i get
   is this one:
 * > Fatal error: Call to undefined function add_shortcode() in /home/xxxxx/public_html/
   > wp-includes/functions.php on line 66

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [kilinkis](https://wordpress.org/support/users/kilinkis/)
 * (@kilinkis)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/add_shortcode-problem/#post-1334050)
 * i have the same problem, could you solve it?
    thx
 *  [racer x](https://wordpress.org/support/users/racer-x-1/)
 * (@racer-x-1)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/add_shortcode-problem/#post-1334051)
 * What folder have you put this in?
 * Do you realize NOT to use wp-includes folder for these types of things?
 * You should have a functions.php file in your theme. If not, create one and put
   the code there.
 *  [azahi](https://wordpress.org/support/users/azahi/)
 * (@azahi)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/add_shortcode-problem/#post-1334134)
 * I do that racer x…. what can i do to solve the problem?
 * sry for my english
 * regards

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘add_shortcode problem!’ is closed to new replies.

## Tags

 * [add_shortcode](https://wordpress.org/support/topic-tag/add_shortcode/)
 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 4 participants
 * Last reply from: [azahi](https://wordpress.org/support/users/azahi/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/add_shortcode-problem/#post-1334134)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
