Access specific Widgets Blocks Content through PHP
-
Hi Danny,
I love this plugin – so useful!
I am trying to build a nice little interface for my client where she can choose different widgets to be shown in the sidebar of pages. I want to create some widget blocks and offer those contents to be chosen and a page by page basis. For that I would like to use php in my theme to access the widget blocks content.
Is there any way to do that?
I could use a php function that I just feed with an ID of the widget and it displays the title and content. Could you provide such code?The most common way to access widgets is this:
the_widget('My_Custom_Widget');
Could this work with Widget Blocks as well?
The problem is that it is not really just one widget but a kinda custom post type, right?
- The topic ‘Access specific Widgets Blocks Content through PHP’ is closed to new replies.