I am facing some issues with the WooSidebars here. I want to integrate Woosidebars with my WordPress theme. While your sidebars can detect and replace the sidebars in my theme, I am unable to use WooSidebar’s sidebars in my theme.
Since WooSidebars create a custom post type I have tried everything :
dynamic_sidebar(‘X’) function does not work. I have tried replacing X with Post Id, Post Title, Post Slug.
I got some clue from class-woo-sidebars.php -> register_custom_sidebars() function where it registers sidebars : register_sidebar( array( ‘name’ => $v->post_title, ‘id’ => $v->post_name, ‘description’ => $v->post_excerpt ) );
the $v->post_name in dynamic_sidebar(‘X’) is also not working. My theme provides an option to select the sidebar with a post. It stores the Sidebars in Post custom fields.
I ask users to select the sidebars from WooSidebars but upon selection the post.php calls the dynamic_sidebar(‘X’) function which is where it shows nothing.
Any clues/Help would be great.
Hi Mr. Vibe,
Thanks for your query. 🙂
To clarify, no code modification is required in order to use WooSidebars.
If your theme has a sidebar called, for instance, “primary”, you can create custom widget areas with WooSidebars to replace the “primary” sidebar according to the conditions you set (for example, a specific page).
This will automatically replace that sidebar under the given conditions, without any code modification (you select “Primary” under the “Sidebar to Replace” box when adding your custom widget area).
You can also call these custom widget areas manually using the slug of the sidebar as the sidebar name. For example, if the slug of a custom widget area is “my-custom-area”, you can call
dynamic_sidebar( 'my-custom-area' );and those widgets will display.
I hope this clarifies your query. If not, please let me know. 🙂
Thanks and regards,
- The topic ‘Integrating WooSidebars in a Theme ?’ is closed to new replies.