I have built a custom options panel which allows site owners to enter their social profiles. I then use the second code to make the links appear in the theme.
When no link is entered in the options panel, I would like there to be no link called on the page where the code is being called. Currently, it provides me with a link to the homepage of my site.
Take a look: http://themeforward.com/demo2/ - the green box is the facebook link, the purple is the google link
I know what you're thinking - why not just leave it the way it is? Because, I'm styling each link with a background image rather than using normal text links... so if I just leave it this way we will still have an image showing up advertising a social site presence, but it won't be linked. The styling can be found here: http://pastebin.com/m3PrBDae I think that may be affecting this.
In my functions
array( "name" => "Facebook Page",
"desc" => "Enter your Facebook address. (Must include http://)",
"id" => $shortname."_facebook",
"type" => "text",
"std" => ""),
array( "name" => "Google Plus",
"desc" => "Enter your Google Plus address. (Must include http://)",
"id" => $shortname."_google_plus",
"type" => "text",
"std" => ""),
How I call them
<a href="<?php echo get_option('to_facebook'); ?>"></a>
<a href="<?php echo get_option('to_google_plus'); ?>"></a>
get_option('to_facebook')return? – Chip Bennett Nov 28 '11 at 20:38get_option( 'to_facebook' )return, right now, when you output it? Does it return null, false, blank, a string, etc.? – Chip Bennett Nov 29 '11 at 17:59get_option(). How about this: what do you get withvar_dump( get_option( 'to_facebook' ) )? – Chip Bennett Nov 29 '11 at 19:41