Notifications
Clear all

Limited Support

Our support team is currently on holiday from December 25, 2025 to January 7, 2026, and replies may be delayed during this period.

We appreciate your patience and understanding while our team is away. Thank you for being part of the wpForo community!

Merry Christmas and Happy Holidays! πŸŽ„

wpForo 1.x.x [Solved] Create a custom widget

2 Posts
1 Users
0 Reactions
1,310 Views
netvilox
Posts: 64
Topic starter
(@netvilox)
Estimable Member
Joined: 7 years ago

I will like to create a custom widget in my wpforo. How possible this. This is how I created one in my wordpress theme.

I added the code below on my wordpress theme function.php.

function wpb_widgets_init() {
 
    register_sidebar( array(
        'name'          => 'Custom Header Widget Area',
        'id'            => 'custom-header-widget',
        'before_widget' => '<div class="chw-widget">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2 class="chw-title">',
        'after_title'   => '</h2>',
    ) );
 
}
add_action( 'widgets_init', 'wpb_widgets_init' );

Then add this to the place i want the widget to be. But I tried it on wpforo it didn't work.Β 

Β 

<?php
 
if ( is_active_sidebar( 'custom-header-widget' ) ) : ?>
    <div id="header-widget-area" class="chw-widget-area widget-area" role="complementary">
    <?php dynamic_sidebar( 'custom-header-widget' ); ?>
    </div>
     
<?php endif; ?>

Topic Tags
1 Reply
netvilox
Posts: 64
Topic starter
(@netvilox)
Estimable Member
Joined: 7 years ago

Solved I added the first code in my theme's function.php then the second in wpforo.Β