Skip to content
Taproot
Taproot
WordPress theme

main

  • Blocks
    • Text
      • Paragraph
      • Heading
      • List
      • Pullquote
      • Quote
      • Code
      • Preformatted
      • Table
      • Verse
    • Media
      • Image
      • Gallery
      • Audio
      • Cover Image
      • File
      • Media Text
      • Video
    • Design
      • Button
      • Columns
      • Separator
      • Spacer
    • Embeds
      • YouTube
      • WordPress
      • Twitter
    • Widgets
      • Social Icons
      • Latest Posts
  • Layouts
    • Sidebar on right
    • Sidebar on left
    • Center
    • Wide
    • Wide/Left
    • Wide/Center
  • Docs
  • Download

Custom Sidebars

By default, Taproot has five built-in widget areas. A “primary” sidebar that is used when selecting a left or right sidebar layout for a page, and 4 “footer” widget areas.

Additional sidebar areas can be added using the default WordPress “register_sidebar” function.

To display your custom sidebar in a particular location, you can use the ‘hybrid/view/sidebar/data’ filter with the required logic to decide which pages to apply your customization to.

<?php
/**
 * Define a custom sidebar for post with the id of '123'. 
 */
add_filter( 'hybrid/view/sidebar/data', function($data){
    if(is_single('123') {
        $data['sidebar'] = 'my-custom-sidebar';
    }
    return $data;
});

If adding to a single post or page, make sure to choose a left or right sidebar layout in the Taproot Page Settings.

Coming Soon: I have been working on a plugin for sidebars that will add the following functionality:

  • Create new custom widget areas in the WordPress Widgets admin page.
  • Choose the widget area you wish to display on a given post type or on a “per post” basis.
  • Define unique colors for each custom sidebar area.

Docs

  • Getting Started
  • Customizer
    • General
    • Layout
    • Header
    • Footer
    • Colors
    • Typography
    • Post Types
      • Posts
        • Post
        • Post Archive
        • Post Entry
      • Pages
    • Navigation
    • Sidebar
  • Single Page/Post Options
  • Block Editor
  • Custom Templates
  • Custom Sidebars

© 2021 Sky Shabatura