Notifications
Clear all

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

2 Posts
1 Users
0 Reactions
838 Views
netvilox
Posts: 64
Topic starter
(@netvilox)
Estimable Member
Joined: 5 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: 5 years ago

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