GithubHelp home page GithubHelp logo

dywp / wordpress-sidebar-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awps/smk-sidebar-generator

0.0 2.0 0.0 511 KB

Generate unlimited sidebars in Wordpress

JavaScript 22.94% CSS 27.70% PHP 49.36%

wordpress-sidebar-generator's Introduction

##SMK Sidebars Generator This plugin generates as many sidebars as you need. Then allows you to place them on any page you wish.

Important info: I'm working for version 3.0 which will support custom sidebars without touching a single line of code. If you want to get acces to first beta, click the following link, subscribe and I will send it to you when it's ready: http://eepurl.com/QeMOf

Demo video: http://youtu.be/fluNdMnSCKA

Note: To use this plugin you'll need to modify the source code of your theme or paste the generated shortcode where you want to show a specific sidebar. Read below for instructions.

####Features:

  • Full AJAX (add, remove, save, validation, etc.)
  • Drag to sort sidebar position.
  • Name validation(characters and duplicate).
  • Display sidebars using WP built-in function, a custom function or a shortcode.
  • Get registered sidebars anywhere you need them.(theme options, metaboxes, widgets, etc.)

####How to install this plugin? Like any other Wordpress plugin.
Drop smk-sidebar-generator to wp-content/plugins/.
More info here: http://codex.wordpress.org/Managing_Plugins#Installing_Plugins

####Quick Installation

  1. Upload the smk-sidebar-generator folder to the /wp-content/plugins/ directory
  2. Activate the SMK Sidebar Generator plugin through the 'Plugins' menu in WordPress
  3. Configure the plugin by going to the SMK Sidebars menu that appears in your admin menu

###Install it from Wordpress.org:

Get all sidebars in an array: Add this function in your theme functions.php:

if(! function_exists('smk_get_all_sidebars') ) {
	function smk_get_all_sidebars(){
		global $wp_registered_sidebars;
		$all_sidebars = array();
		if ( $wp_registered_sidebars && ! is_wp_error( $wp_registered_sidebars ) ) {
			
			foreach ( $wp_registered_sidebars as $sidebar ) {
				$all_sidebars[ $sidebar['id'] ] = $sidebar['name'];
			}
			
		}
		return $all_sidebars;
	}
}

Now using this function you can get all sidebars in an array([id] => [name]):

print_r( smk_get_all_sidebars() )

result of the above code(example)

array(
  "sidebarID" => "Default Sidebar",
  "anotherID" => "Sidebar Name",
  "smk_sbg_18" => "Sidebar Name 1",
  "smk_sbg_7" => "Sidebar Name Something"
)

You can output this anywhere in page/post metaboxes, theme options, etc. Example with php foreach:

echo '<select>';
  foreach($the_sidebars as $key => $value){
    echo '<option value="'. $key .'">'. $value .'</option>';
  }
echo '</select>';

Display a sidebar using smk_sidebar function:

if(function_exists('smk_sidebar'){
 smk_sidebar('sidebarID');
}

Display a sidebar using wp native function:

if(function_exists('dynamic_sidebar') && dynamic_sidebar('sidebarID')) : 
				endif;

Display a sidebar using built-in shortcode:

[smk_sidebar id="sidebarID"]

##Releases and Changelog https://github.com/Smartik89/Wordpress-Sidebar-Generator/releases

wordpress-sidebar-generator's People

Contributors

awps avatar fastimo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.