Artem Dremov
asked 7 years ago

Hey there,
I need sidebar on single question page.
Thanks in advance.

2 Answers
DominicStaff
answered 7 years ago

Please send me username & password of your site, I will check and help you resolve it.

Artem Dremov
replied 7 years ago

Well, I send username & password, but nothing happens. Please reply.

Dominic Staff
replied 7 years ago

Where? I can not find your info. Please use private answer in this question and send me your username & password.

Artem Dremov
replied 7 years ago

Added private answer to this question.

Dominic Staff
replied 7 years ago

I have accessed your site but I can not install the plugin to help you customize the theme. Also, the files in your site have not permission to edit from the back-end. Please send me your FTP account.

Artem Dremov
replied 7 years ago

Added one more private answer to this question.

Artem Dremov
replied 7 years ago

Added one more private answer to this question.

DominicStaff
answered 7 years ago

I can not access your FTP, In this case, you can add the following code to the functions.php file:

/**
 * Register our sidebars and widgetized areas in question page.
 *
 */
function wpb_widgets_init() {
 register_sidebar( array(
 'name' => __( 'Question single sidebar', 'wpb' ),
 'id' => 'single-sidebar',
 'description' => __( 'Show widget into Single question', 'wpb' ),
 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
 'after_widget' => '</aside>',
 'before_title' => '<h3 class="widget-title">',
 'after_title' => '</h3>',
 ) );
 }
 add_action( 'widgets_init', 'wpb_widgets_init' );

Then add the following code to the single-question.php file under line 21:

<div class="">
 <?php dynamic_sidebar( 'single-sidebar' ); ?> 
</div>
Artem Dremov
replied 7 years ago

Thank you! But added your code, it doesn’t work though.

Artem Dremov
replied 7 years ago

Again, there is no FTP access for website, *only* SFTP. I use Cyberduck to access the code of the website.

Dominic Staff
replied 7 years ago

I have checked your site and see that the code works fine. I think you have resolved this issue.

Powered by DW Question & Answer Pro