Add Google AdSense into Top Wide Sidebar in WordPress Suffusion Theme

2011-06-11


To add a Google AdSense adv into top wide sidebar area in WordPress suffusion theme. You have different solutions.

Here we list 2 solutions:

1: Using Widget:

Go to WordPress admin panel,  Appearance->Widgets

You can see Wide Sidebar (Top) on right side, drag a Text widget into it.

suffusionAddAdv00 Click the right triangle on the text widget to expand it, insert your Google Adsense code into the text area: suffusionAddAdv01 Save it. Then you will see your Google Adsense adv shown at the top wide sidebar area. **2: Modify file manually:** If you use widget, you will find there is a wrap box outside of your AdSense ads. If you don’t like this box, suffusion theme does not provide an option to remove it. So we have to find a way to remove it: change file. The file which you can select might not be only one, here we select the file **actions.php,** and for our case, we want to add an ads to top right side in sidebar’s area. opent actions.php and locate the function “**suffusion_print_right_sidebars()**”, find the following code:

// Show Wide Sidebar Top if there are 2 right sidebars
if ($right_count == 2) {
    echo "<div id='sidebar-wrap' class='sidebar-wrap sidebar-wrap-right fix'>";
    if (!suffusion_is_sidebar_empty(18)) {
        suffusion_print_sidebar(18, 'wsidebar-top', 'Wide Sidebar (Top)', $suf_wa_wst_style, 'right');
    }
} 

Then add your AdSense code right after above code, for better layout, you might need to add <div></div> to wrap your AdSense code:


<div align="center">

your adsense code here

</div>

 

After you add your AdSense code, you have to adjust your Siderbar’s width to match the width of your AdSense.

You have to adjust 2 places for the width:

1: Menu “Other Graphical Elements” –> “Other Graphical Elements”

suffusionAddAdv02

Scroll down and find “Sidebar Width Settings”, you can change sidebar1 and sidebar2 width here. The width settings reflect to single page’s sidebars

2: Menu “Template” –> “Double Right Sidebars”:

you also should change the width for double right sidebars here. the width settings here reflect to home page’s sidebars