bagaslite
asked 8 years ago

Hallo, designwall I had a problem, I want to create a custom sidebar on dwqa plugin, but I can not make it, can you help me?
 
yesterday, yesterday, I tried myself by following this article https://www.designwall.com/question/sidebar-2/ , but failed !!
 
1. I make dwqa-templates folder in my theme ( see picture )

 
2.and then I copy data dwqa plugin public_html/wp-content/plugins/dw-question-answer/templates
 
 
 
to theme/dwqa-templates Then I make file sidebar-single.php on dwqa-templates and then fill it with code, this code I can from https://www.designwall.com/question/sidebar-2/
 

<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
 <div id="secondary" class="widget-area" role="complementary">
 <?php dynamic_sidebar( 'sidebar-1' ); ?>
 </div><!-- #secondary -->
 <?php endif; ?>

after that I log into wordpress and go to the apperance -> widgets, I did not find a custom sidebar I wanted 🙁 i only find default sidebar wordpress and custom sidebar wpforo
 

 
I think it’s easy, it was very difficult, , can you help me more details? please help  

1 Answers
Kevin
answered 8 years ago

Hi,

Please add the code below to wp-content/themes/your-theme-folder/functions.php

function dwqa_theme_widget_init() {
	register_sidebar( array(
		'name'          => __( 'Questions Sidebar', 'dw-base' ),
		'id'            => 'sidebar-1',
		'description'   => '',
		'before_widget' => '',
		'after_widget'  => '',
		'before_title'  => '',
		'after_title'   => '',
	) );
}
add_action( 'widgets_init', 'dwqa_theme_widget_init' );
Powered by DW Question & Answer Pro