Title: Retrieving variables from functions.php
Last modified: August 22, 2016

---

# Retrieving variables from functions.php

 *  Resolved [combobreaker](https://wordpress.org/support/users/combobreaker/)
 * (@combobreaker)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/retrieving-variables-from-functionsphp/)
 * I have created a simple array in functions.php that stores all my social links
   to be used throughout my site.
 *     ```
       $socialURLS = array(
       	"facebook"		=> "http://www.facebook.com/XXXXX",
       	"linkedin"		=> "http://www.linkedin.com/company/XXXXX",
       	"google-plus"	=> "https://plus.google.com/XXXXX",
       	"twitter"		=> "http://twitter.com/XXXXX",
       	"ustream"		=> "http://www.ustream.tv/channel/XXXXX",
       	"instagram"		=> "http://instagram.com/XXXXX",
       	"pinterest"		=> "http://www.pinterest.com/XXXXX",
       	"flickr"		=> "http://www.flickr.com/photos/XXXXX/",
       	"tumblr"		=> "http://XXXXX.tumblr.com/"
       );
       ```
   
 * When I retrieve a URL from a page, everything works as expected. However, when
   I try to output anything on front-page.php, nothing outputs.
 * `<?php echo $socialURLS["facebook"]; ?>`
 * Is there anything special about front-page.php that would cause this behavior?

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/retrieving-variables-from-functionsphp/#post-5888657)
 * You probably need to declare $socialURLS as global:
 * `<?php global $socialURLS; echo $socialURLS["facebook"]; ?>`
 *  Thread Starter [combobreaker](https://wordpress.org/support/users/combobreaker/)
 * (@combobreaker)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/retrieving-variables-from-functionsphp/#post-5888682)
 * This worked great. Thanks!

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

The topic ‘Retrieving variables from functions.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [combobreaker](https://wordpress.org/support/users/combobreaker/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/retrieving-variables-from-functionsphp/#post-5888682)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
