• Nomi

    (@naumanahmed19)


    Is this possible to register sidebar / widget area from a custom widget?. If you have any idea please let me know.

    I can create it from custom theme and custom plugin. But I want to create from widget.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I could be wrong, but I don’t think that it would be.

    The reason for this is that widgets go inside sidebars, so you’d need to have the sidebar set up before you could add the widget to it.

    Can I ask why you want to do it this way instead of adding it in the “normal” way?

    Thread Starter Nomi

    (@naumanahmed19)

    Its a part of project.

    I have a default sidebar area. When I will add this widget to sidebar it will give option to create more sidebars.

    I am looking for some technique to do that. Actually I am going to use this same method to some other framework. But its only possible if I can get it work in widgets.

    It is posible I guess, but it’s not an optimal way to do it.

    You can set up a widget that takes new sidebar names and stores them, most likely in the database, then set up another function to read that value and create the sidebars. Have a look at the register_sidebar() function as that’s what you’ll need.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Register Widget Areas from Custom Widget’ is closed to new replies.