Need Advice? CALL: +61 417949565

Riksi - web design and development

  • Home
  • ABOUT US
  • OUR WORK
  • BLOG
  • CONTACT US
  • Home
  • BLOG
  • Web developing
  • PHP
  • Create & Use Dynamic Sidebar in WordPress

Create & Use Dynamic Sidebar in WordPress

Create & Use Dynamic Sidebar in WordPress

if you looking for a way to create a new sidebar area, to add widget and show on different part of website(footer,header,left, right or main content section), you can use dynamic_sidebar() function.

 

Sidebar registration
PHP
1
2
3
4
5
6
7
8
9
10
11
12
 
 
<?php
//register new sidebar
register_sidebar(
array( 'id' => 'Sidebar_Name',
'name' => 'Sidebar Name'
)
);
?>
 
 

Call and use new registered sidebar by using dynamic_sidebar() function in any theme PHP file.

1
2
3
4
5
6
7
8
 
 
<?php
// Call the new sidebar
dynamic_sidebar("Sidebar_Name");
?>
 
 

After that, you can see the new sidebar in backend’s widget area:

riksi-demo-sidebar

you can use following parameters with register sidebar:

  • ‘description’
  • ‘class’
  • ‘before_widget’
  • ‘after_widget’
  • ‘before_title’
  • ‘after_title’

More read at: https://codex.wordpress.org/Function_Reference/register_sidebar

Tagged under: sidebar
Nick
Wednesday, 03 February 2016 / Published in PHP, Web developing, Wordpress

What you can read next

PHP – Create a customised log function
Complete Guide to setup remote Git on your site
Migrate WordPress server from Local to Live

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archive

  • General
    • Smart Home
  • Web developing
    • command line
    • CSS
    • General
    • git
    • Javascript
    • Laravel
    • Magento
    • MySQL
    • PHP
    • Security
    • Shopify
    • Wordpress

Recent Posts

  • Install HomeAssistant on Raspberry pi

  • Shopify ERR_INVALID_ARG_TYPE Error

Riksi

Riksi is a creative, professional & cutting-edge custom web design and development company.

HERE TO HELP

  • BLOG
  • Contact Us
  • Our Work
  • About Us

New on Blog

  • Install HomeAssistant on Raspberry pi

    To install it, We need to connect the SD card t...
  • Shopify ERR_INVALID_ARG_TYPE Error

    fix the Internal Server Error occurred while in...

GET IN TOUCH

T: (+61) 417 949 565
Email: [email protected]

Contact Us
Fill out the form and our team will be in touch with you promptly. Thank you for your interest!

AU & NZ
T: (+613) 9014 9495
T: (+61) 417 949 565
Email: [email protected]


US & Canada
Email: [email protected]

NAME

EMAIL

PROJECT TYPE
PROJECT BUDGET

MESSAGE

Could not authenticate you.

Whats on Instagram

Loading...

Tags

.htaccess calculation cherry pick composer content css deployer documentation error flex general knowledge get started git git stash hack javascript log mysql package password php PHP Trick replace scss shopify sidebar ssh symlink sync trick ubuntu windows 10 wordpress trick wp
  • GET SOCIAL
Riksi - web design and development

© 2020 All rights reserved. Riksi.com.

TOP