Home » wordpress

Wordpress Widgets Wherever


Submitted by Dan on Saturday, 28 June 200817 Comments
Wordpress Widgets Wherever

If you are a Wordpress user then you know how much of a saviour widgets has been. Long gone are the days of keeping your sidebar.php file open to make edits every time you need to add a plugin. And among the many who’ve spent hours customizing their sites only to accidentaly make a typo in the file and mess up your whole site widgets have eliminated that worry. Now when you add a plugin that supports widgets you simply use a drag and drop interface to place the plugin where you want it to display.

If you didn’t know this already you can actually use widgets in other places on your website and not just the sidebars. For example at the bottom of this post just above the comments form is a section that lists related posts. In the past I would have to edit the file single.php and after installing the Related Posts plugin and add some php code to the file for it to show where I want it. Now I can just go to my widgets section in Wordpress and add whatever I want down there as a widget instead of editing php code. You could do the same thing for your header or footer or anywhere else on your site.

To do this edit the file functions.php inside your theme’s folder and look for the function to create a widget, it will look like this:

if ( function_exists('register_sidebar') ) // Sidebar Widget
    register_sidebar(array(
        'name' => 'Bottom of Post',
        'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ));

Copy and paste that code and create and second and even third copy if you want one after the other and then change the name of it to something unique. Next open the theme file that you want to add this new widget section to and add the following code:


Default left sidebar stuff here…

Now when you go to your widgets section you will see another menu you can customize from the dropdown section. Do this as many times as you need to.

widget setup

No TweetBacks yet. (Be the first to Tweet this post)

17 Comments »

  • Sherin (3 comments) said:

    Seems this is a niche idea. Most powerful and helpful for wordpress blog. I hope I can use the same to my word press blog. Is there any version of this available for blogger bloggers?

    Sherin

    [Reply]

  • Serial Box Crime » Blog Archive » » 125×125 Ad blocks for your Wordpress Sidebar said:

    [...] help with positioning and using Widgets you can visit my previous article on how to place widgets anywhere in your blog. If you enjoyed this post please leave a comment or subscribe to my rss feed Enter your email [...]

  • Bridal Showers (1 comments) said:

    Great post, Cleared many doubts,Will be looking forward to using the technique in the coming projects. Thanks Cheers

    [Reply]

  • Champion Sawyer (1 comments) said:

    Very interesting post. Nice blog by the way!

    [Reply]

  • Spicy Forex (1 comments) said:

    Hey, great post there! Im first time here visited your blog, definitely will visit back later, keep it up :)

    [Reply]

  • Sabac | Autoclaves Australia (1 comments) said:

    There are many widget ready themes available and there are many widgets available as well. Thanks for sharing the code and way it works. At least I know now how we can implement our own codes or widgets. Wordpress makes our lives so easy and wonderful.

    [Reply]

  • how to make money online (1 comments) said:

    i’m actually wondering how they put those plugins up. hehe, thanks for the info, i’m a newbie wp user.

    [Reply]

  • Web Design Los Angeles (2 comments) said:

    Great insights. I was not aware of this. You have nicely described. This information also helps to those who have no idea about it. Thanks for sharing…

    [Reply]

  • Gratis Weblog (1 comments) said:

    Hey,

    Nice blog and really thanks for sharing the code and way it works. At least I know now how we can implement our own codes or widgets.

    Wordpress makes our lives so easy and wonderful.

    :):):)

    [Reply]

  • Vini (1 comments) said:

    Wow, that great… It will show option for header and footer as well. That’s mean we can add more widget areas on the blog. Hence make easy to change whole blog, whenever required. good Idea thanks

    [Reply]

  • RevJeff (1 comments) said:

    Thanks for this, I have limited experience with php and less time, so I have been limited to widget ready themes. This gives me some ideas, and it helps me to learn more about php.

    RevJeffs last blog post..15 Creative and Profitable Ways to Use Autoresponders

    [Reply]

  • how to get rid of pimple fast (1 comments) said:

    Pretty informative for a short post, my kind of site. Less read with bulks of info. Thanks btw now I’m able to enjoy more my WP blog.

    [Reply]

  • skyplus (1 comments) said:

    Thanks for your good information and also i like to know about this more details so if you know something related WordPress widgets continue this type of posting.Thanks for sharing your tips.

    [Reply]

  • Web Design Basingstoke (2 comments) said:

    Thanks for sharing this. There are many plugins out there but all I use now is the CustomWidget pluigins, simply allows you to do anything.

    [Reply]

  • wordpress widgets | WORDPRESS said:

    [...] Serial Box Crime » Wordpress Widgets Wherever [...]

  • ghana news (1 comments) said:

    its a great information for my realated topics i am also Wordpress user.i am confuse for this topics but for solve to thanks for this information.

    [Reply]

  • yoli (1 comments) said:

    Great post,i Will be looking forward to using the technique in the coming projects. Thanks

    [Reply]

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.


Comments links could be nofollow free.