Today let’s learn a simple quick trick on how to create a custom widget. For my example I will show you how I created my Showcase widget located in the middle, to the right of the posts.
First under your functions.php
file type in the following:
<?php // Custom Widget function MyCustomWidget() { ?> <li class="widget"> <h2 class="heading">Latest Showcase</h2> <ul> <?php include(TEMPLATEPATH . '/includes/showcase.php'); ?> </ul> </li> <?php } register_sidebar_widget('The Custom Widget for Showcase', 'MyCustomWidget'); ?>
<?php
and ?>
for it to work.<li<
because my sidebar’s start and end with <ul<
.register_sidebar_widget('the widget title', 'the name of the function');
“That’s it! Now you have a custom widget with what ever you want!
WordPress has emerged as not only a leading blogging platform but also a content management…
Properly configured, Wordpress can be an extremely effective way of designing, maintaining and managing your…
WordPress 2.7 Beta 3 has been released for your testing pleasure. Here are some of…
This little trick is really simple and easy. All you need to do is plug…
This powerful plugin is a must-have for WordPress users. With WP-DBManager you can manage your…