CBX Dynamic Sidebar

Dynamic sidebar for wordpress using custom post type and shortcode

Author:Codeboxr (profile at wordpress.org)
WordPress version required:3.0.1
WordPress version tested:5.4.1
Plugin version:1.0.5
Added to WordPress repository:13-06-2015
Last updated:03-05-2020
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:https://codeboxr.com/product/cbx-dynamic-side...
Total downloads:1 791
Active installs:20+
plugin download
Click to start download

CBX Dynamic Sidebar for WordPress helps to create dynamic sidebar or widget position using custom post type. Sometimes we need to put sidebar inside content and this plugin
helps to create sidebar using custom post type and put the sidebar inside content using shortcode using simple shortcode

[cbxdynamicsidebar id=”post id here” /]

It’a also possible to call the sidebar using direction function call in theme

 <?php

    if(function_exists('cbxdynamicsidebar_display')){
      $sidebar_id   = 'post id here';
     $config_array = array(
         'id'            => $sidebar_id,
         'wclass'        => 'cbxdynamicsidebar_wrapper',
         'wid'           => 'cbxdynamicsidebar_wrapper',
         'float'         => 'none'
     );
     echo cbxdynamicsidebar_display($config_array);
    }

  ?>

or more simple way

 <?php
    do_shortcode('[cbxdynamicsidebar id="post id here"]');
  ?>

See the gist here

From the custom post type “cbxsidebar” post edit screen there are other features that is implemented using meta field for

  • sidebar class
  • sidebar description
  • sidebar before widget html wrapper
  • sidebar after widget html wrapper
  • sidebar widget before title html wrapper
  • sidebar widget after title html wrapper
  • sidebar enable disable without deleting the sidebar post
  • Translation ready
  • Gutenberg block support (From v1.0.5)

Shortcode & function Param Definition

id – sidebar post id

wclass – sidebar will be wrapper in a div and it will have a class from the value of param ‘class’, default value is ‘cbxdynamicsidebar_wrapper’. also extra another class will be added using ‘cbxdynamicsidebar_wrapper’ with sidebar id at last

wid – sidebar will be wrapper in a div and it will have a class from the value of param ‘cbxdynamicsidebar_wrapper’, default value is ‘cbxdynamicsidebar_wrapper’ with sidebar id at last

float – default value ‘none’, other possible values ‘left’, ‘right’, which means float none/auto, float left and float right

For shortcode with all possible param –

[cbxdynamicsidebar id=”post id here” float=”left” wclass=”cbxdynamicsidebar_wrapper” wid=”cbxdynamicsidebar_wrapper” /]

For more details check here