How can I specify that an area of my custom WordPress theme have to contains widgets\modules?

I am pretty new in WordPress theme development and I am developing a theme that use BootStra CSS framework

I have to do that a specific area of my theme can contains some widget\module (I don't know what is the correct name in WP, I am refering to the tool setted by backend that show some components output as a gallery immage or a slideshow)

Someone can help me to understand this argument? from what can I start to do this operation?

Tnx

Andrea

Solutions

Welcome to wordpress :)

So first thing is to register widget area. In you functions.php place the following code:

$args = array(
'name'          => __( 'Sidebar name', 'theme_text_domain' ), // name that will show up in the admin
'id'            => 'unique-sidebar-id',
'description'   => '',
    'class'         => '',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget'  => '</li>',
'before_title'  => '<h2 class="widgettitle">',
'after_title'   => '</h2>' );

register_sidebar( $args );

For the reference see official codex page

Next, call dynamic_sidebar() function where you want the content to show up on the site, usually sidebar.php

<?php if ( is_active_sidebar( 'unique-sidebar-id' ) ) : ?> //display widget area only if there are widgets asigned in the admin
<ul id="sidebar">
    <?php dynamic_sidebar( 'unique-sidebar-id' ); ?>
</ul>
<?php endif; ?>

I hope this will get you started.

Similar questions

I have a widget area in my header. How can I have that display a different widget depending on what group is shown?
I have a widget area in my header. How can I have that display a different widget depending on what group is shown? So if uses are in a group about say Baseball in the site Header in my theme the Widget on Baseball shows up but if the user is in a group on Golf then the header shows a widget I have for Golf? Can this be done?
Make a custom script modules
i want to make a script that read a folder with the files in it(modules,plugins) but i dont know how where to start,can i get from you guys examples?I want to make like wordpress or joomla plugins
Why in my WordPress custom theme the widget area don't work? Widgets are not shown
I am developing this WordPress custom theme: http://onofri.org/WP_BootStrap and I am trying to insert a widget area under the Partner e Sostenitori section, but can't work. I have performed the following operations: 1) I have put the following code into the functions.php theme file: As you can see the name of the widgetized area is My_Widgtet_Area ...
Expanding / Collapsing Modules in Wordpress Panel
I'm using WordPress 3.3.2. version. I can't able to expand / collapse modules in wordpress panel. I have deactivated all plugins and checked. But no result. If i disable Java Script, it is working well. Can any one please give me a solution?
(Divi): How to make Wordpress load images of specific size for Blurb modules on given page with a funciton?
I have 28 pictures uploaded to media library, each around 3mb. Wordpress has already created resized copies of those: thumbnails, medium and large. The pictures are used as Divi's Blurb module images on a given page. They are all being loaded full sized (even if I choose Large when picking an image for module). 28*3mb is a lot. What I want, is to w...
using python [xmlrpc frontend] modules on google app engine to connect to a wordpress blog
I'm using pyblog module (python blogger) [See P.S. at the bottom for wordpress_xmlrpc] to automate operations on a wordpress blog, as suggested here. Pyblog home page describes a simple using script: When I run it locally, the script works fine. But when I deploy it on google app engine, I encounter the following error about the blog.get_recent_pos...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.