Adding content to sidebars

Add a meta box to the post editor, similar to the excerpt meta box, and get the content of the meta box in your sidebar. If you want to reuse the same text on different pages create a custom post type sidenotes and add a meta box with a select field to let the author … Read more

Specific and Different Ads for each Post?

Hi @ewakened: The simplest solution would be to have them upload the ads as photos using the media features in WordPress and then to have them add custom field called “Advertisement” with the URL to the ad copied from the media module, and a custom field called and “Ad URL” to link to the advertiser’s … Read more

Change which sidebar get_sidebar() gets from functions.php

Get sidebar is a really thin wrapper around locate_template, which just searches the current child theme and parent theme directory for the given sidebar. get_sidebar in wp-includes/general-template.php: $templates = array(); if ( isset($name) ) $templates[] = “sidebar-{$name}.php”; $templates[] = ‘sidebar.php’; // Backward compat code will be removed in a future release if (” == locate_template($templates, … Read more

Sidebar Generator? :)

The code for this plugin is actually pretty simple. The init function loops through all the sidebars (stored in the wp_options table) and registers them in wordpress: <?php function init(){ //go through each sidebar and register it $sidebars = sidebar_generator::get_sidebars(); if(is_array($sidebars)){ foreach($sidebars as $sidebar){ $sidebar_class = sidebar_generator::name_to_class($sidebar); register_sidebar(array( ‘name’=>$sidebar, ‘before_widget’ => ‘<li id=”%1$s” class=”widget sbg_widget … Read more

Custom sidebar not showing in the dashboard

Register sidebar. add_action( ‘widgets_init’, ‘wpse_123456_widgets_init’ ); function wpse_123456_widgets_init() { $args = array( ‘name’ => __( ‘Sidebar name’, ‘theme_text_domain’ ), ‘id’ => ‘unique-sidebar-id’, ‘description’ => ”, ‘class’ => ”, ‘before_widget’ => ‘<li id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</li>’, ‘before_title’ => ‘<h2 class=”widgettitle”>’, ‘after_title’ => ‘</h2>’ ); if ( function_exists (‘register_sidebar’)) { register_sidebar( $args ); } } … Read more