Welcome! To use this support forum, please Login or Join Today!

   

Widget in Header

{name}
Rank

Total Posts: 3

Joined 2011-09-30

PM

 

Hello Casey! Would be possible to fit the slide to the side of the image header or better, you could add a widget to the side of the logo ... thanks

Image Attachments

Widget_in_Header.png

Click thumbnail to see full-size image

{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 

You could initiate the widget location by adding this to widgets.php:

register_sidebar(array(
  'name' => 'Header Widget',
 'id' => 'header-widget',
 'description' => 'Shown in header.',
 'before_widget' => '<div id="headerad"><div class="inside">',
 'after_widget' => '</div></div>',
 'before_title' => '',
 'after_title' => '',
));

then in header.php, call the widget explicitly by replacing:

 <?php if (get_option('sthemes_show_header_ad')) { ?>
  <div id="headerad">
   <a href="<?php echo (get_option('sthemes_header_ad_url'));?>"><img src="<?php echo (get_option('sthemes_header_ad_img'));?>" alt="ad"/></a>
  </div>
 <?php } ?>

with:

<?php if (is_active_sidebar('header-widget') ) {dynamic_sidebar('header-widget');};?>

 

 

{name}
Rank

Total Posts: 3

Joined 2012-08-07

PM

 

Hi Casey ...

This is just what I wanted… I’ve used a text widget to insert an image of the company telephone number and email, but the image it not to the right of the page, but it’s next to the logo on the left.

I’m assuming I’ll need some CSS trickery to get around this?  Can you help?

Many Thanks