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!
Using a WordPress theme for a website comes with plenty of advantages. One great feature…
How can you link QR codes to digital content? When a QR code is read…
As a writer, or as a business owner doing some serious blogging, you probably wish…
Is WordPress Easy for Beginners? Yes, WordPress in all fairness is clean for novices to…
With time and innovation, WordPress has undergone a lot of changes and is now completely…
With the recession taking over the majority of economies across the globe, securing your job…