Code for WP Sidebar

functions.php
<?php
function newx(){
register_sidebar(array(
'name' => 'left sidebar',
'description' => 'You can add widget here',
'id' => 'leftsidebar',
'before_title' => '<h3>',
'after-title' => '</h3>',
'before_widget' => '',
'after_widget' => ''
));
register_sidebar(array(
'name' => 'Right sidebar',
'description' => 'You can add right widget here',
'id' => 'rightsidebar'
));
}

add_action('widgets_init','newx');
?>

index.php
<?php dynamic_sidebar('leftsidebar'); ?>

Comments

Popular posts from this blog

Deploy laravel application to digital ocean droplet

WP register_post_type() with custom CMB2 meta box

Git post receive setup at server for git push to the production from local machine