Display a Widget in WordPress Theme


Display a Widget in WordPress Theme

It’s really a simple process.

For doing so Just follow the process bellow
First Declayer it in the theme function like bellow

======================================

<?php

if  ( function_exists (‘register_sidebar’))

register_sidebar (array(

‘name’ => __( ‘widget name’, ‘theme name ),

‘before_widget’  => ‘ ‘ ,
‘after_widget’  => ‘ ‘

‘before_title’  => ‘<h2> ‘ ,

‘after_title’  => ‘</h2> ‘ ,

));

 

=======================================

Declare  Widget where you wnat like the way below
=======================================

<div id=”custom_widget”>
<?php is_active_sidebar(‘widget name’); ?>

<?php dynamic_sidebar(‘widget name’); ?>
</div>

=======================================

Tags: , , , ,

Comments & Responses

You must be logged in to post a comment.