Continue Reading..." />

My help on Max Banner Ads – No 2

Hi all,

below is my second post, I hope you enjoy it. This will help you place banners all over your site, I’m no pro and I can do it. THAT MEANS YOU CAN TO

As you can see from my site, there are banners all over the place. Previously, I only had one sidebar and that was hell. Please visit this link to see how to associate your banners with your zones and then use them as a widget.

How to Widgetize your theme

Please follow the following steps:

  • Go to Design, then to Theme Editor
  • Clicks on functions.php which would be labeled as Theme Functions
  • There will most probably be something like the following in that file
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
  • I added the following to create a few extra widgets, please see image below.


register_sidebar(array(
'name' => 'Sidebar 2',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h2>',
 'after_title' => '</h2>'
));

register_sidebar(array(
'name' => 'Sidebar 3',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));

register_sidebar(array(
'name' => 'Top of Blog',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));

mba help show how to edit functions file 300x159 My help on Max Banner Ads   No 2

Now you save the file. Please be careful when doing this as if something is wrong then your screen will go blank. I normally just edit the file via some text editor and then upload it to my server. I had many problems trying to figure this out, I have to admit that my screen went blank many times.

  • Go to Design, then to Widgets

The next picture shows you the widgets that I just created. From the drop down menu, you can see there are a few widgets. Yours new widgets should show up here, if not then something is wrong with your functions.php file.

mba help dropdown menu show widgets 300x128 My help on Max Banner Ads   No 2

mba help show plugin for widget 300x142 My help on Max Banner Ads   No 2

  • Now add your plugins to your widget
  • Click on Save
  • Repeat process for other widgets
  • Go to Design, then to Theme Editor
  • Select your header.php file or another file
  • Enter the following code to display your widget, this widget would show me the banners on top of my blog (468×60)


<?php     /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(4) ) : ?>
<?php endif; ?>

When you create the widgets in the functions.php file, they are numbered. These numbers relate to how they are listed when adding plugins to your widgets and it is also used to display the widget.

Widgets in functions.php file Number to use in code
Sidebar 11
Sidebar22
Sidebar33
Top of Blog4
Footer Left5
Footer Center6
Footer Right7
  • Click Save and check your site.

Below is a picture of mine where it shows the 468×60 banner. This process must be repeated to show your widgets. You can edit the footer, post, page, etc. The choice is yours.

mba help show my site banner 300x166 My help on Max Banner Ads   No 2

Once you have added more widgets to your them, you can use these widgets for any plugin you desire which is installed on your server.

Let me know if this helped!

  • Twitter
  • Digg
  • Delicious
  • Submit post to StumbleUpon
  • Submit post to Facebook
  • Submit post to LinkedIn
From the desk of George Serradinho

I am the proud owner of Serradinho.com and have made this my second home. I'm into blogging, downloads, WordPress, meeting and helping others, etc. Basically the internet in general :) Serradinho Web Services is my own company whereby I offer my services to clients. This ranges from web design, website upgrades, theme customizations, support, premium WordPress plugins and many more .....

View all posts by , there might be other posts that interest you.

{ 1 comment }

Tom June 26, 2008 at 6:00 pm

Hi,

thanks for the info.

You have made my day :laughman:

Comments on this entry are closed.

Previous post:

Next post:



    

Join our Revenue Sharing Program today.

Follow George Serradinho on Twitter - username: @gfserradinho.   Connect via Facebook.   Connect via LinkedIn.   Follow George Serradinho on Google.   Connect via YouTube.   Connect via Skype.

*/ ?>