Title: adding echo get_option correctly
Last modified: August 20, 2016

---

# adding echo get_option correctly

 *  [HorrorUK](https://wordpress.org/support/users/horroruk/)
 * (@horroruk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/)
 * I have the following code, but I need to add a line of code from the WP admin
   to this, but can’t figure out how to do that.
 * I started off with this:
 *     ```
       <?php
       $app_id = "echo get_option('appid');";
       ?>
       ```
   
 * Then I tried to add the line of code from admin using:
 *     ```
       $app_id = "echo get_option('appid');";
       ```
   
 * A bit too literal maybe, so I removed the semi-colon within the quotes:
 *     ```
       $app_id = "echo get_option('appid')";
       ```
   
 * I’m running out of hair to pull out, so if anybody can help, that would be great.
 * Thanks.

Viewing 8 replies - 16 through 23 (of 23 total)

[←](https://wordpress.org/support/topic/adding-echo-get_option-correctly/?output_format=md)
[1](https://wordpress.org/support/topic/adding-echo-get_option-correctly/?output_format=md)
2

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558787)
 * > Fatal error: Call to undefined function get_option()
 * I missed this. Re-upload a fresh copy of the core files (with the obvious exception
   of the wp-content folder)?
 *  Thread Starter [HorrorUK](https://wordpress.org/support/users/horroruk/)
 * (@horroruk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558788)
 * I’m just re-uploading those files.
 * The options can be viewed on that URL. That’s a useful thing I didn’t know I 
   could do – the great thing about WP.
 *  Thread Starter [HorrorUK](https://wordpress.org/support/users/horroruk/)
 * (@horroruk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558789)
 * The files have been uploaded, and the error is still there:
 * > Fatal error: Call to undefined function get_option() in /var/www/vhosts/writers-
   > site.com/httpdocs/wp-content/plugins/facebook-tabs-for-wordpress/fbindex.php
   > on line 6
 * Line 6 is:
 *     ```
       $app_id = get_option('tabsappid');
       ```
   
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558831)
 * Oh – this is officially weird. Try as I might, I cannot replicate that error.
   And `get_option()` has been part of WP core since version 1.5! Try deleting all
   files & folders – **except** the wp-content folder plus your wp-config.php & 
   root .htaccess file. Then re-upload everything – except wp-content -from a **
   fresh** download of WordPress.
 *  Thread Starter [HorrorUK](https://wordpress.org/support/users/horroruk/)
 * (@horroruk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558835)
 * Thanks, I’ll give that a go.
 * Just to be clear about how this is set up. This is all in a folder within the
   plugins folder. There is the main index.php file which holds the plugin code 
   at the top and the code for the admin page, then this file which is within the
   same folder.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558838)
 * It should still work within a plugin.
 *  Thread Starter [HorrorUK](https://wordpress.org/support/users/horroruk/)
 * (@horroruk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558842)
 * Still the same problem.
 * Am I supposed to do something with that page to say that it should be calling
   from wordpress?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558844)
 * It could be something to do with the way in which you’re creating the plugin 
   generally (although I have to say that I’ve never come across this kind of error
   in plugin development before). Have you reviewed [Writing_a_Plugin](http://codex.wordpress.org/Writing_a_Plugin)
   and the [Settings_API]?

Viewing 8 replies - 16 through 23 (of 23 total)

[←](https://wordpress.org/support/topic/adding-echo-get_option-correctly/?output_format=md)
[1](https://wordpress.org/support/topic/adding-echo-get_option-correctly/?output_format=md)
2

The topic ‘adding echo get_option correctly’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 23 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/adding-echo-get_option-correctly/page/2/#post-2558844)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
