0

Is it possible to create another widgets.php page? say widgets-ads.php?

I want to make it for displaying ads in my website by drag and drop of widgets in a predefined sidebars.

3
  • I'm going to guess what you want is to create new widgets, which you can do extending the WP_Widget class with the Widgets API. Take a look at default-widgets.php and see how the widgets bundled with WordPress are coded and go from there. Jan 22 '15 at 18:58
  • You can also register new sidebars using the Widgets API
    – Tom J Nowell
    Jan 22 '15 at 19:07
  • It's not about using the same widgets.php page in the admincp, it's about creating a new widgets page with sidebars and widgets in it, separated from the default widgets.php.
    – Ahmed Saad
    Jan 22 '15 at 19:09
0

you would need to create widget areas and new widgets http://codex.wordpress.org/Widgetizing_Themes

4
  • Answers like rely on links aren't very helpful because if the link goes bad or changes, the answer becomes useless. Maybe you could add some example code for registering a new widget and explain the process? Jan 22 '15 at 19:53
  • even if that is a codex link? would it be better if I took that same info and pasted it here? what about the Widgets API link you gave?
    – Ray Flores
    Jan 22 '15 at 19:59
  • I gave it in a comment. Even if it's the codex, yes, see how to answer. And welcome to WordPress Stack Exchange! Jan 22 '15 at 20:01
  • yes, well, the only way i could add a comment was to have more rep :) which i could not do yet :) so i was looking to just add a 'comment' and found this was the only way... sorry for barging, and thanks for the welcome :)
    – Ray Flores
    Jan 22 '15 at 20:09
0

If you are not into coding you can simply use a plugin that permits multiple sidebars. Go to the Plugin repository and search for sidebars. Several of the plugins permit the establishment of multiple sidebars and permit using a different sidebar on on each page/post/category. Then just put different widgets in each sidebar to have the ads change.

Or, going another way use a plugin like Widget Visibility to use a single sidebar and then set a particular widget to display only on specific pages/posts. This capability is also included in a Jetpack module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.