Query for sidebar layout
-
Topic
-
Hi Jason,
I am trying to get a custom field value at the top of the right sidebar. The sidebar hook “themeblvd_fixed_sidebar_before” is applied to both sidebars, and I only want the custom field value to display at the top of one sidebar not both.
I am using this code:
function sidebar_content (){ global $post; ?> <?php $sidebarcustom = get_post_meta($post->ID, 'right_sidebar', true); ?> <?php if($sidebarcustom !== '') { ?> <div class="sidebar-custom"><?php echo $sidebarcustom; ?></div> <?php } else { echo 'NOTHING HERE'; } ?> <?php } if( themeblvd_config( 'sidebar_layout' ) == 'sidebar_right' ){ add_action('themeblvd_fixed_sidebar_before','sidebar_content'); }
This works fine without the conditional if(themeblvd_config…. But then it gets the content at the top of both sidebars. What if any would be the appropriate syntax to query for the sidebar layout?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.