One of my favorite features of WordPress is the fact that it is so very customizable. And it’s so very easy to add in pieces that maintains a level of control over the site without having to manually change PHP or HTML files. You can access it all from within the back end of WordPress.
You can customize these pieces and this extra control with Widgets. I’m not going to go into to much detail here. If you’ve been using WordPress for very long you know what Widgets are.
The key point here is that you can add a Widget section and then easily control, add, edit the content of that section from the admin of WordPress under the Appearance section.
Adding a Widget section is pretty straight forward even. In your functions.php file, (or custom_functions.php for Thesis) you will just need to add something similar to the following line:
register_sidebar(array('name'=>'New Widget', 'before_title'=>'<h3>', 'after_title'=>'</h3>'));
The above is pretty simple right? The “name” is set to whatever you want to call it. And then you set the tags you want to wrap around the title. Make sure you use something descriptive for the name so you know what the widget is for.
After adding this to the function file you should be able to visit the Widgets section under Appearance and start adding Widgets to it immediately.
But we still have to decide where the widget is going to show up.
So in your template page you’ll need to add some code to set where the Widget shows up. Usually you’ll add some default text that will display if there are no Widgets for that section yet. Here’s an example, naturally you can style it how you want:
<div id="footer-widgeted">
<div>
<ul id="footer-widget">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('New Widget') ) : ?>
<li>
<h3>Testing Widget Area</h3>
<p>This is an example of a widgeted area.</p>
</li>
<?php endif; ?>
</ul>
</div>
</div>
That should do it. In a future post I’ll go into more detail and give some specific examples of adding widgets around a site.
Related posts:
{ 6 comments… read them below or add one }
Автомобильный блог, автоновости, авто тюнинг, новые автомобили, спорткары, концепт
SiteSubscribe: That sounds like a WP-bug of some sort. Shouldn’t be bcseuae of the plugin I don’t think.Harry: At the moment this plugin only works with the custom post type. Not sure why the social media/share buttons shows though. Which plugin is it and I could have a look at it?Anna: Try the beta 3 of version 1.0.0. That version has a search function. But it sounds like a bug that only 10 latests posts shows. So I will fix that and I think it’s time for a 1.0.0 version after that. 0
H9VoLA , [url=http://zbrecdorvmda.com/]zbrecdorvmda[/url], [link=http://wwxmucjlltnh.com/]wwxmucjlltnh[/link], http://ztxrskojswzk.com/
Financial News Advices
Добрый день.По вашему рецепту я ждал целый день ни хера.В итоге, добавил в файл header.php непосредственно после через 10 минут все заработало. WP 3.1.1
The Insurance Blogger is an expert independent blog providing news and comment on all aspects of the USA insurance industry.