Soma Pro Theme Help Premium theme

Header widget?

RD Started by Rich Dixon · March 20, 2018 at 7:07 pm · 1 reply 1 voice Last reply 8 years, 3 months ago
RD
Rich Dixon Original poster Member
#1

I’m using the shop header. Figured out how to hide the search form, which I don’t need.

Can I add a widget to the blank space beside the logo? I’d like to add another small image that’s a link to my blog on another site.

Thanks.

ST
Spiracle Themes Original poster
#2

Hi Rich,

Follow the steps below, you need to edit some PHP files. Be careful in updating the theme as you will lose your change on theme update. So I suggest you do not update the theme after this.

Step 1) Go to the theme root folder ie somapro (wp-content/themes/somapro)
Step 2) Open functions.php in any text editor and after line 188 add the following code and save it

register_sidebar( array(
    'name'          => __( 'Custom Logo Sidebar', 'somapro' ),
    'id'            => 'custom-logo-sidebar',
    'description'   => __( 'Add widgets here.', 'somapro' ),
    'before_widget' => '<div id="%1$s" class="section %2$s">',
    'after_widget'  => '</div>',
    'before_title'  => '',
    'after_title'   => '',
  ) );

View Screenshot

Step 3) Go to inc/header-functions.php and open it in any text editor.
Step 4) After line 213 remove the div having class name products-search and add the following code in place of that and save it

<div class="custom-logo-sidebar" style="text-align: right;">
<?php
if(is_active_sidebar('custom-logo-sidebar')){
dynamic_sidebar('custom-logo-sidebar');
}
?>
</div>

View Screenshot 2

Step 5) Now go to Appearance -> Widgets and add Image widget in Custom Logo Sidebar

Step 6) you can set its margin, padding through CSS

Best Regards

Post a reply

Join the conversation. Be kind — this is a public forum.

Replying to Header widget?

By posting, your reply becomes public (unless marked private).