How can I add sidebar manually?

5.91K viewsCore
0

Hello.
I want to add sidebar manually at the right side because sidebar widget is not working. Currently I’m editing `base.php` inside of default theme.

<?php dynamic_sidebar( 'ap-top' ); ?>
<div style='width:100%;height:30px;background:#333;'>

</div>
<div id="ap-lists" class="clearfix" style='width:80%; float:left;'>
	<?php ap_questions_tab(get_permalink()); ?>
	<?php if ( $questions->have_posts() ) : ?>
		<div class="question-list">
	<?php
		
		/* Start the Loop */
		while ( $questions->have_posts() ) : $questions->the_post();
			global $post;
			include(ap_get_theme_location('content-list.php'));
		endwhile;
	?>
		</div>
	<?php 
		ap_pagination();
	?>
	<?php
		else : 
			include(ap_get_theme_location('content-none.php'));
		endif; 
	?>	
</div>

<div style='width:20%;height:100px;background:#444;float:right;'>
	`Can I add here sidebar widget ?`
	
</div>

Thank you very much.

0

Hi Janob,

I think this is a general WordPress question and there may be better locations to ask this question.
The base.php is part of the AnsPress theme an not the right place to add sidebars.
Look on the internet how to add a sidebar to your WordPress theme, or use a theme that already has a right-side sidebar, such as the default and free WP theme “Twenty Fourteen”.
It has a “Content Sidebar”. You can add (AnsPress-) Widgets to that sidebar in the Appearance > Widgets settings.

You are viewing 1 out of 3 answers, click here to view all answers.