get_options isn't returning a value when used inside sidebar.php
-
Hi there, have come across a strange problem, I’m unable to return and display one of my theme options when I try to call get_options() from within my sidebar.php file.
I’ve tried to call the same option from other page templates such as index.php, header.php etc and it works perfectly fine but as soon as I call the option from the sidebar file I get nothing…no idea what’s going on here.
This is the code I’m using…like I said the option is definetly being stored properly cause i’m able to access it perfectly fine from other parts of my theme.
<div id="sidebar"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar') ) : ?> <div class="side_box"> <? if(get_field('google-maps')) {?> <h3><? echo get_option($shortname.'_google_maps_heading',''); ?></h3> <iframe src="<? echo get_field('google-maps') ?>" width="300" height="250" frameborder="0" style="border:0"></iframe> <?}?> </div><!--//side_box--> <?php endif; ?> </div><!--//sidebar-->
Thanks in advance for your help!!
Mikael
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘get_options isn't returning a value when used inside sidebar.php’ is closed to new replies.