,

Do Not Sideline Sidebars in WP themes: Leverage Them

It has been thirteen years that WordPress is in the web arena and yet stands undefeated with a colossal number of websites counting on it.

wordpress stats

Its pre-built themes, be it paid or free, offers a lot of customization in the hands of the users. Wherefore, we have an ample lot of themes that can get us the most suited theme for our website or our blog.

However, it has happened many a times when different people choose one particular theme. This has happened with me just a few days ago, as I was working with two different clients but both were a kind of apparel selling agencies and coincidentally both of them chose the same theme. This was an odd situation and when I was checking out other sites (for inspiration), I realized that there are many who choose one particular theme and this will result in similarity. What to do in order to create a distinguished look for the users?

The answer to this question was to make requisite changes depending on the needs of the users.

As WordPress offers a high degree of customization which gives us the leverage to customize the theme as per the custom needs of a website or the way you like it to be. One of the most effective technique to add singularity to your WordPress sites is by using sidebars.

What is a sidebar?

Okay let’s, split the word ‘Sidebar’ into two – side and bar. A bar on the side of a website is known as the side bar or a widget- ready area which can contain some information . Moreover , there is no dictum that you need to display any particular type of information in the sidebars , such as many say that this part of the website comprises of content other than the main content. Likewise, it holds no such position or placement. You can place it vertically , horizontally , above or below the header, footer, content or any goddamn place on your website where you feel like.

Below is an image of a web page which comprises of a sidebar on the left hand side.

side bar example 3

Or if you want to place it on the right hand side, you can check this out.

sidebar example 4

Now using a sidebar ingeniously is completely dependent on the designers and how they can use their creativity in order to make use of this widget ready space. There are themes which allow multiple widgets all you need to do it to utilize them to the fullest.

You can use this space to showcase your top posts, related posts, recent blogs or any other stuff which you consider to be engaging enough for your website.

Or if you do not have a blog, you can creatively use it for third party brand endorsements. Furthermore, it allows the users to drag and drop some items into the sidebar for this you need to move to the admin panel and then to Appearance → widgets . Moreover, there are numerous WordPress themes which come with great customization and configuration options of building dynamic layouts for give a distinct look to the different sections of your website. This allows users to add a sidebar of their own by making use of the drag and drop interface.

Step 1 – Register your sidebar :

In order to begin with your sidebar you have to register to custom sidebar with the help WordPress function which is present by default: register_sidebar().

Now open up the file for your them functions which functions.php() file if it already exist and if it do not, then you need to create one before moving on to the next step.

Note: If you cannot get a functions.php file, then you can add function call at any place where you wish to. Moreover, if your theme comprises of only one slidebar, then also there should be one functions.pho file which is needed.

Here is the code which you can look up to as an example for adding a sidebar in a WordPress theme:

/**
 * Being with the Registration process of the  two sidebars (widget-ready areas).
 *
 * @since WordPress version 1.0
 *
 * @return void
 */
function myfirstwidget_widgets_init() {
 
  register_sidebar( array(
 
    'name'          => __( 'Main Widget Area', 'myfirstwidget' ),
 
    'id'            => 'sidebar-first',
 
    'description'   => __( 'Will be displayed in the footer section of the site.', ' myfirstwidget' ),
 
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
 
    'after_widget'  => '</aside>',
 
    'before_title'  => '<h3 class="widget-title">',
 
    'after_title'   => '</h3>',
 
  ) ); 
 
  register_sidebar( array(
 
    'name'          => __( 'Secondary Widget Area', 'myfirstwidget' ),
 
    'id'            => 'sidebar-second',
 
    'description'   => __( 'Applied to pages and post in the sidebar.', 'myfirstwidget' ),
 
    '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', 'myfirstwidget_widgets_init' );

Step 2 – Displaying a custom sidebar in your WP theme :

sidebar ex 5

After successful registration to the sidebar, you then need to decide where to place the new sidebar in your WordPress theme.

Certainly there is no fixed position for placing a side bar and this also changes depending on your WordPress theme which you have installed. Here I am mentioning the code for adding a sidebar horizontally in your post.

<div id="secondary" class="mysidebar-block" role="complementary">
 <div class="widget-area1">
  <?php dynamic_sidebar( 'myfirst-sidebar' );?>
 </div><!-- .widget-area1 -->
</div><!-- #secondary -->

The Twenty Fifteen theme of WordPress will make use of the code written above in the “sidebar-main.php” file for featuring the sidebar: mysidebar-first. As mentioned in the code written above, A function named as dynamic_sidebar is made. This is because, by chance, even if a single widget is not assigned to your sidebar in your WP theme, then you can do it by using the following code:

<?php dynamic_sidebar($index);?> 

The index is the code mentioned above must carry the id or the name of the dynamic sidebar you created.

In order to view your newly created sidebar you need to go down to Appearance → Widgets menu.

How to add widgets in the widget ready space?

sidebar 6

As we have already discussed that sidebar is a widget ready area which generally comprises of widget tools to drag and drop elements in the sidebar. Now, this is important to know how to add widgets in the sidebar.

With time a website also grows and so it the data which is to be depicted and along with the functionalities, as the widgets of WordPress keeps on evolving. For example, after sometime you might need to incorporate widgets in your sidebar which can display custom data on your website. This can be a method for resurrecting your old blog post on your website.

Once you have added a new widget ready space or a sidebar to your WP theme, the next step is to add widgets in that very place.

In order to do so you can take inspiration from the code mentioned below:

<?php
function dashboard_widget_function($post,$callback_args) {
echo "My First Custom Widget";
}
function add_dashboard_widgets() {
wp_add_dashboard_widget('dashboard_widget1','Dashboard Widget Example','dashboard_widget_function1');
}
add_action('wp_dashboard_setup1','add_dashboard_widgets1');
?>

Summing it up!

sidebare ex 7

I used sidebars to intelligently to make two websites of the same genre in a different way. Well sidebars if used with utmost precision can serve numerous purposes as well.

All you have to do is to think and utilize it and not to sideline the purpose which sidebars can serve.

I hope this blog serves as a good resource for you!

31 responses to “Do Not Sideline Sidebars in WP themes: Leverage Them”

  1. tentoto Avatar

    [9252]tentoto | Login Resmi Link Alternatif Situs Slot Gacor Hari Ini,tentoto menyediakan link alternatif terbaru untuk akses mudah. Nikmati daftar casino deposit pulsa serta panduan cara main toto online. Bergabunglah sekarang juga! visit: tentoto

  2. onfire Avatar

    [4389]onfire Login Oficial | Mejores Slots y Depósitos con Coppel,Accede a onfire para disfrutar las mejores slots online. Descarga nuestra app y realiza tus depósitos con Coppel de forma segura. ¡Regístrate y empieza a jugar hoy! visit: onfire

  3. ce88 Avatar

    Gambling enthusiasts, give ce88 a look! Not really my favorite, to be blunt, but it’s worth a shot if you like a bit of adventure! You can check it out for yourselves right here: ce88

  4. tableplusbet Avatar

    [6374]tableplusbet Official Login | Pinakamabilis na GCash Casino PH,Mag-login sa tableplusbet para sa legit na online casino sa PH. I-download ang app at alamin kung paano maglaro ng slots gamit ang mabilis na GCash. Sali na! visit: tableplusbet

  5. 789bet Avatar

    [206]সেরা অনলাইন ক্যাসিনো (789bet) – বাংলাদেশের বিশ্বস্ত বেটিং সাইট,বাংলাদেশের সেরা অনলাইন ক্যাসিনো 789bet-এ স্বাগতম। এটি একটি বিশ্বস্ত বেটিং সাইট যেখানে আপনি পাবেন নিরাপদ গেমপ্লে, আকর্ষণীয় বোনাস এবং দ্রুত পেমেন্ট সুবিধা। আজই যোগ দিন! visit: 789bet

  6. xjilicc Avatar

    Found xjilicc through a friend and I am glad I did. The payouts are fair and the customer support is actually helpful. A solid choice for gaming enthusiasts.

  7. gt99 Avatar

    [5023]gt99 অফিসিয়াল লগইন | সেরা অনলাইন স্লট ও বিকাশ ডিপোজিট,gt99 অ্যাপ ডাউনলোড করে সেরা অনলাইন স্লট গেম উপভোগ করুন। বিকাশ দিয়ে সহজে ডিপোজিট এবং আকর্ষণীয় বোনাস নিয়মাবলী জানতে আজই জয়েন করুন। visit: gt99

  8. ph36login Avatar

    PH36 Login is super quick and easy to use. No annoying lag that I have experienced. Log in securely here: ph36login

  9. togelcc Avatar

    [466]togelcc | Login Resmi Link Alternatif & Slot Gacor Hari Ini,togelcc menyediakan akses login resmi dan link alternatif terbaru. Nikmati daftar situs casino online terlengkap dengan cara deposit via dana yang mudah. Gabung sekarang! visit: togelcc

  10. romancasino Avatar

    [286]romancasino অফিসিয়াল লগইন | সেরা অনলাইন স্লট ও দ্রুত বিকাশ পেমেন্ট,romancasino অ্যাপ ডাউনলোড করে সেরা অনলাইন স্লট গেম খেলুন। এখানে পাবেন দ্রুত বিকাশ পেমেন্ট এবং সহজ গাইডলাইন। আজই যোগ দিয়ে আপনার অভিজ্ঞতা শুরু করুন। visit: romancasino

  11. pointsbetaustralia Avatar

    As an Aussie who loves a bit of sport and casual gaming this site nails the vibe we all enjoy. The loyalty program actually rewards consistent players and the support team replies within minutes. I especially love how they keep the promotions seasonal so it never feels stale. Definitely my favorite spot to log on and unwind. pointsbetaustralia

  12. bw29login Avatar

    Best platform I have used in the Philippines so far. The local payment options make it so much easier to manage my account. Highly recommended. bw29login

  13. 8cassinobetlogin Avatar

    Finally found a place where the login process is actually seamless. No lagging and the bonuses are actually fair. Love the vibe here. 8cassinobetlogin

  14. vvnn Avatar

    [7282]vvnn – Link vào vvnn và hướng dẫn chơi baccarat online,vvnn cung cấp link vào không chặn, hỗ trợ tải app vvnn nhanh chóng. Khám phá mẹo quay hũ nổ hũ và nạp tiền casino qua momo tiện lợi. Truy cập để trải nghiệm ngay! visit: vvnn

  15. bd345 Avatar

    [1482]bd345 লগইন এবং অ্যাপ ডাউনলোড | সেরা অনলাইন স্লট গেম,bd345 লগইন করে সেরা অনলাইন স্লট গেম খেলুন। বিকাশ দিয়ে ক্যাসিনো ডিপোজিট এবং অ্যাপ ডাউনলোড apk এর সহজ উপায় জানতে আজই ভিজিট করুন। visit: bd345

  16. bwin sport Avatar

    [8353]bwin sport লগইন এবং অ্যাপ ডাউনলোড | বিকাশ ক্যাসিনো ডিপোজিট,bwin sport লগইন করে অনলাইনে স্লট গেম খেলার নিয়ম জানুন এবং দ্রুত bwin sport app download করুন। বিকাশ দিয়ে ক্যাসিনো ডিপোজিট করে আজই শুরু করুন। visit: bwin sport

  17. indwin7download Avatar

    The download was super fast and the app installation was a breeze. It runs perfectly on my phone. Thanks for the easy setup indwin7download.

  18. sh777link Avatar

    Quick registration and even quicker access. I was worried about the connection but this link works perfectly every time. Great job on the optimization. Visit sh777link now.

  19. khozkutop6b Avatar

    [9713]khozkutop6b Login | Trusted Online Slot Malaysia APK,khozkutop6b is your gateway to a trusted online slot Malaysia experience. Enjoy easy casino deposit via touch n go and get the APK download. Join now! visit: khozkutop6b

  20. stonevegas Avatar

    [1733]stonevegas লগইন এবং অ্যাপ ডাউনলোড | সেরা অনলাইন স্লটস গেম,stonevegas লগইন করুন এবং অ্যাপ ডাউনলোড করে লাইভ ক্যাসিনো খেলার নিয়ম জানুন। এখন বিকাশ দিয়ে ক্যাসিনো গেম খেলে বিনোদন পান। আজই জয়েন করুন। visit: stonevegas

  21. 444winlogin Avatar

    Fast access and no annoying redirects. It is exactly what I needed to get back into the action quickly. Thanks for keeping 444winlogin so stable.

  22. br45t Avatar

    Clean design and very straightforward. I didn’t have to spend any time figuring out how things work. br45t is definitely a top-tier choice.

  23. mmli777 Avatar

    I have been playing here for a few weeks now and the consistency is what really stands out. The VIP program rewards loyalty genuinely and the monthly cashback calculations are completely transparent. I love the selection of classic table games and the new slot drops keep getting more interesting. Definitely one of the most reliable platforms I have used lately. mmli777

  24. thabetnewba5 Avatar

    Combined sports and casino under one roof and the experience is incredibly smooth from start to finish. I love how the betting slips calculate instantly and the slot section loads new titles every week without any glitches. New members get a really generous starter package that actually works with the games I already enjoy playing. thabetnewba5

  25. rogtoto Avatar

    You took a topic that could have gone flat and breathed such life into it that I never once wanted it to reach an end. The calm assurance in your writing convinced me that the path you describe is one a person like me could truly travel. Thank you for putting so much of yourself into this and please know I will be waiting eagerly for whatever comes next.

  26. 1cassinoonline Avatar

    One of the best online casino experiences I have had recently. The graphics are crisp and the gameplay is very fair. 1cassinoonline

  27. ph3jl1 Avatar

    Finding a casino app that does not crash on my older phone was a huge relief. The download process is straightforward and every game loads without killing my battery. Customer service is always on standby and they resolve issues within hours. Trust this platform for daily entertainment ph3jl1

  28. krbetso88 Avatar

    As a regular sports fan this platform handles my bets perfectly. The odds are competitive and I love how the mobile site adjusts to my screen without breaking. Support team is polite and knows their stuff when I need help. krbetso88

  29. 1xbet Avatar

    [4211]1xbet বাংলাদেশ লগইন ও অ্যাপ ডাউনলোড | বিকাশ ক্যাসিনো গেম,1xbet বাংলাদেশ লগইন করে উপভোগ করুন লাইভ ডিলার ক্যাসিনো সাইট এবং অনলাইন স্লট গেম ট্রিকস। বিকাশ দিয়ে ক্যাসিনো গেম খেলতে আজই অ্যাপটি ডাউনলোড করুন। visit: 1xbet

  30. idobengbet Avatar

    I have been exploring different betting platforms lately and truly enjoyed my time here. The interface feels smooth and the odds are pretty competitive. It feels like having a reliable friend who always has your back when you are placing a bet. idobengbet

  31. jilibet178casinologin Avatar

    Everything about this site is professional and user friendly. The games are fair and the rewards are real. Check out jilibet178casinologin

Leave a Reply

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