Add 3 Widgets After The Beautiful Pro Themes Header

In this tutorial, i’ll provide all the working PHP & CSS code to add 3 widgets after the header in the Beautiful pro theme by StudioPress.

These widgets will only display on the first page of the front page.

This means we’ll be removing the default full width background image which is coded to display site wide after the header.

Here’s what the widgets look like when populated with images:

Widgets Front Page Only

Please Click Each Image If You Would Like To View The Original Size

1. Register & Hook Widgets After Header

This code goes at the end of your child themes functions.php file.

It includes a conditional tag & query which only returns true on the first page of this themes front page.

2. Style Each Widget

This code should be pasted at the end of your style.css file before the start of the Media Queries.

The first 3 CSS rules style each widget and the last rule adds a class so you can use CSS to target the entire area all 3 widgets are contained in.

3. Mobile Queries

Here’s what the widgets look like WITHOUT any CSS code added to the media queries when populated with images.

ipad view - no media queries

If you prefer the widgets align one on top of each other, add this CSS code:

And here’s what it will look like once the screen re-sizes below 768px:

ipad full width

Note: Clearly you will want to add/modify the CSS code if you populate the widget areas with anything other than images.

4. PHP Code Which Needs Removing or Commenting Out

You will need to either remove or comment out this PHP code between Lines 37-61 and 100-106.

Its not essential that all this code is removed however it is suggested you do this as the code is no longer being used.

Looks pretty slick i think especially with the nice mobile menu. How about you?

Related Posts


Comments

5 responses to “Add 3 Widgets After The Beautiful Pro Themes Header”

  1. Jennifer Gropper Avatar
    Jennifer Gropper

    Hi Brad,

    Will this code work with the Genesis sample child theme? If not, would you be able to provide the code tweaks or a separate tutorial for customizing to the child theme? Thank you so very much in advance. And thank you for all of your excellent tips on this site, You are my “goto” reference!

    Jennifer

    1. Brad Dalton Avatar
      Brad Dalton

      Sent you an email Jennifer. Did you get it?

      1. Jennifer Avatar
        Jennifer

        Hi Brad,

        Just checking back in and yes – I did get an email from you asking if I needed help with something. What I would like to do is add 3 widgets after the header on the homepage in the Genesis Sample Child Theme. Is this possible? If not, no worries. Thank you again.

  2. Mickey Avatar

    Hee Brad,

    Just needed to thank you for your awesome tips and trics! Makes my life much more easy.

    Greetz Mickey

    1. Brad Dalton Avatar
      Brad Dalton

      No worries Mickey.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.