Archived topic
Place a widget in elements
1 reply · Started by Dimitrios on September 7, 2021
Dear GeneratePress team,
How I could place a widget in elements or in post/page area?
Thank you
Dimitris
Hi there,
it depends, if the Widget has a Block Version available in the editor then you can simply add the Block to your post content or a hook element.
If it doesn't then you can widgetize a GP Hook - heres an example that will point you in the right direction:
In the code - this line is where you set the GP hook:
add_action('generate_menu_bar_items', function(){
ie. replace generate_menu_bar_items with the relevant hook.
More info on widgetizing: