I want to create dynamic widget in wordpress , Please help to get this done in standard and easy way. I have read below post but did not satisfied :
Leave a Reply
You must be logged in to post a comment.
I want to create dynamic widget in wordpress , Please help to get this done in standard and easy way. I have read below post but did not satisfied :
You must be logged in to post a comment.
First of all you will need to register your sidebar or widget ready area for your theme. You can register multiple sidebars and widget ready areas. Copy and paste this code in your themeâs functions.php file`
`
In above code, we have registered two sidebars. We set them names and descriptions to identify them on Widgets screen. The description parameter can be used to tell users where this sidebar appears in the theme. The wpb is the name of the theme we are working on, it is used here to make these strings translatable. You should replace it with your theme name.
In this example code, we have used sidebar id to call the sidebar we want to display here. Change the sidebar id to display another sidebar. For example, you can register three sidebars for footer area and then call them one by one in your themeâs footer.php template.