This Blog is helps you to solving problems in creating a wordpress widget area.
Well, creating a widget area is not that tough. First of all, you need to register the new area with WordPress Web Development Copmany so it shows up in the administration section. For keeping everything nice and understandable, we need to create a new file in the library directory called customwidget-areas.php. We are also going to reference the new file in function.php. It should be referenced like this:
include(‘library/customwidget-areas.php’);
Once that is taken care of, we need to register it. Now, you need to open your customwidget-areas.php file and make sure the code looks like what is displayed below. To register the area call on the WordPress register_sidebar function. This will allow us to setup the options to define the new sidebar. The code will look something like this:
<?php
// Register the Footer Right
function special_footer_right() {
register_sidebar(array(
‘name’ => ‘Footer Right’,
‘id’ => ‘footer-right’,
‘description’ => __(‘A widget area in the footer, above the subsidiary
➥asides.’, ‘thematic’),
‘before_widget’ => thematic_before_widget(),
‘after_widget’ => thematic_after_widget(),
‘before_title’ => thematic_before_title(),
‘after_title’ => thematic_after_title(), )
);
}
add_action(‘init’, ‘footer_right’);
?>
The array above needs to pass the following values:
Looking for Expert?
Then, we at, Biztech Consultancy would be more than happy to help you. We specialize in WordPress Development WordPress Customization, WordPress Web Development & Maintenance, WordPress Widget Development, WordPress Upgradation, WordPress Theme Development and WordPress Template Designing.
Well, creating a widget area is not that tough. First of all, you need to register the new area with WordPress Web Development Copmany so it shows up in the administration section. For keeping everything nice and understandable, we need to create a new file in the library directory called customwidget-areas.php. We are also going to reference the new file in function.php. It should be referenced like this:
include(‘library/customwidget-areas.php’);
Once that is taken care of, we need to register it. Now, you need to open your customwidget-areas.php file and make sure the code looks like what is displayed below. To register the area call on the WordPress register_sidebar function. This will allow us to setup the options to define the new sidebar. The code will look something like this:
<?php
// Register the Footer Right
function special_footer_right() {
register_sidebar(array(
‘name’ => ‘Footer Right’,
‘id’ => ‘footer-right’,
‘description’ => __(‘A widget area in the footer, above the subsidiary
➥asides.’, ‘thematic’),
‘before_widget’ => thematic_before_widget(),
‘after_widget’ => thematic_after_widget(),
‘before_title’ => thematic_before_title(),
‘after_title’ => thematic_after_title(), )
);
}
add_action(‘init’, ‘footer_right’);
?>
The array above needs to pass the following values:
- Name – We are calling this one ‘Footer Right’
- ID – The ID is used for getting your widget area in a template or when used as the front-end of the div element’s id. We are calling ours ‘footer-right’.
- Description – This purely for descriptive content and will explain the location of the sidebar. It will show up in the back-end interface. Visitors will not see this description.
- The other values after this are all controlled by the thematic theme framework, yet if you want to add markup before and after the title, you can force the framework to recognize your custom code. For demonstration purposes, I am leaving the markup to Thematic.
Looking for Expert?
Then, we at, Biztech Consultancy would be more than happy to help you. We specialize in WordPress Development WordPress Customization, WordPress Web Development & Maintenance, WordPress Widget Development, WordPress Upgradation, WordPress Theme Development and WordPress Template Designing.
No comments:
Post a Comment