Wordpress plugins
Dynamics Sidebars

Dynamics Sidebars

Version : 1.0.7
Tested up to : 4.0.19
Number of download : 12759
Average rating : 5 / 5 on 1 votes 1 votes, 5 avg.rating

Screenshots

Dynamics Sidebars
Dynamics Sidebars
Dynamics Sidebars
Dynamics Sidebars

With DS, it’s possible to change the widgets that display in a sidebar (widgetized area) according to a context (for example, a specific page). Setting up a custom widget area to display across multiple conditions is as easy as a few clicks and code changes. Documentation | Support Forum Usage By default it will add ‘custom-sidebar’ support for the following post types: Post Page IMPORTANT: Showing the sidebar Note you can use this wherever you like to show you sidebar <?php dynamic_sidebar( get_the_sidebar() ); ?> Or <?php $sidebar = get_the_sidebar(); if ( is_active_sidebar( $sidebar ) ) { dynamic_sidebar( $sidebar ); } ?> Adding support for custom post type In order to user this plugin features with your custom post type you must add a feature suppport to it. Do it by doing this: On you ‘functions.php’ file When you register your custom post type, on ‘register_post_type’ call. Function Reference register_post_type for more information <?php $args = array( 'supports' => array( 'custom-sidebar' ) ); register_post_type( 'post_type', $args ); ?> Removing support for pages, posts and/or custom post types To remove support from pages, posts and/or custom post type do like so: On you ‘functions.php’ file add this <?php add_action( 'after_setup_theme', 'theme_setup' ); function theme_setup() { remove_post_type_support( 'post', 'custom-sidebar' ); // to remove from posts remove_post_type_support( 'page', 'custom-sidebar' ); // to remove from pages remove_post_type_support( 'custom post type', 'custom-sidebar' ); // to remove from ctp } ?> Changing sidebar args On your ‘functions.php’ file just add the following code. <?php add_filter( 'ds_sidebar_args', 'my_sidebar_args', 1, 3 ); function my_sidebar_args( $defaults, $sidebar_name, $sidebar_id ) { $args = array( 'description' => "$sidebar_name widget area", 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ); return $args; } ?> Documentation | Support Forum Don’t forget to check the ‘Other Notes’ tab for a list of all function and hook you can use. Internationalization (i18n) This plugin has been translated into the languages listed below: pt_BR – Portuguese Brazil. If you’re interested in doing a translation into your language, please let me know. Api Functions has_sidebar( $post_id = 0 ) the_sidebar( $fallback = ”, $echo = false ) get_the_sidebar( $post_id = 0 ) get_custom_sidebars() get_all_sidebars() Actions ds_plugin_install ds_plugin_uninstall ds_plugin_deactivate ds_init ds_add_metabox ds_render_metabox ds_save ds_register_column Filters the_sidebar ds_save_permissions ds_save_ajax_message ds_save_ajax ds_sidebar_args ds_post_types Constant DS_PLUGIN_FOR_FRONT_PAGE DS_PLUGIN_FOR_POSTS_PAGE

Download now