Simple Page Sidebars - Version 1.0

Version Description

  • Modified check for blog page.
Download this release

Release Info

Developer blazersix
Plugin Icon 128x128 Simple Page Sidebars
Version 1.0
Comparing to
See all releases

Code changes from version 0.2.1 to 1.0

Files changed (2) hide show
  1. readme.txt +47 -7
  2. simple-page-sidebars.php +21 -2
readme.txt CHANGED
@@ -3,25 +3,48 @@ Contributors: blazersix, bradyvercher
3
  Donate link: http://bit.ly/s2zcgD
4
  Tags: sidebars, custom sidebars, dynamic sidebar, simple, widget, widgets
5
  Requires at least: 3.2.1
6
- Tested up to: 3.3.2
7
- Stable tag: 0.2.1
 
 
8
 
9
- Assign custom, widget-enabled sidebars to any page with ease.
10
 
11
  == Description ==
12
 
13
- Designed for simplicity and flexibility, Simple Page Sidebars gives WordPress users and theme authors the ability to assign custom sidebars to individual pages--without making any template changes. Existing sidebars can be assigned in quick edit and bulk edit modes, helping save you time.
14
 
15
- Also included is a widget to allow a sidebar to include all the widgets from any other widget area.
 
 
 
 
 
 
 
16
 
17
  == Installation ==
18
 
19
  Installing Simple Page Sidebars is just like installing most other plugins. [Check out the codex](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins) if you have any questions.
20
 
21
  #### Setup
22
- After installation, go to the Reading options panel (the Reading link under Settings) and choose the default sidebar.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
- *Note: The initial version of Simple Page Sidebars required a template change that is no longer needed in the latest release. It's recommended that any code changes be reverted.*
25
 
26
  == Screenshots ==
27
 
@@ -29,8 +52,25 @@ After installation, go to the Reading options panel (the Reading link under Sett
29
  2. The new sidebar shows up on the widget panel. Notice the new "Widget Area" widget for including other widget areas.
30
  3. Bulk edit in action. Easily assign a sidebar to multiple pages. (Quick edit works, too!)
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  == Changelog ==
33
 
 
 
 
34
  = 0.2.1 =
35
  * Now works for the blog page when it's set in the Reading Settings.
36
  * Bug fixes.
3
  Donate link: http://bit.ly/s2zcgD
4
  Tags: sidebars, custom sidebars, dynamic sidebar, simple, widget, widgets
5
  Requires at least: 3.2.1
6
+ Tested up to: 3.4.1
7
+ Stable tag: 1.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Easily assign custom, widget-enabled sidebars to any page.
12
 
13
  == Description ==
14
 
15
+ Designed for simplicity and flexibility, Simple Page Sidebars gives WordPress users, designers, and developers the ability to assign custom sidebars to individual pages--without making any template changes. Existing sidebars can also be assigned in quick edit and bulk edit modes, helping save you time.
16
 
17
+ = Benefits =
18
+
19
+ * No more site-wide, generic sidebars. Each page (or section) can have its own widgets.
20
+ * Complete control over sidebar names.
21
+ * Assign the same sidebar to multiple pages.
22
+ * A page's sidebar can be modified without creating a pointless revision.
23
+
24
+ Simple Page Sidebars also comes with a "Widget Area" widget for including all the widgets from one sidebar into another.
25
 
26
  == Installation ==
27
 
28
  Installing Simple Page Sidebars is just like installing most other plugins. [Check out the codex](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins) if you have any questions.
29
 
30
  #### Setup
31
+ After installation, go to the Reading options panel (the Reading link under Settings) and choose which registered sidebar is the default sidebar.
32
+
33
+ == Frequently Asked Questions ==
34
+
35
+ = Why is the default sidebar still showing after I've created a custom sidebar for a page? =
36
+
37
+ If you haven't added any widgets to your new custom sidebar, the default sidebar will continue to display. If you really want a blank sidebar, just add an empty text widget.
38
+
39
+ = How do I give my blog a different sidebar? =
40
+
41
+ We recommend that you set your blog to use the default sidebar and create custom sidebars for pages (including the front/homepage). That way your blog page and posts all have the same sidebar.
42
+
43
+ However, if you defined a page for your posts in the Reading settings panel and assigned a custom sidebar to that page, that will work, too.
44
+
45
+ = Can I hide the "Sidebar" column on the Pages screen in the admin panel? =
46
 
47
+ Yes, just click the "Screen Options" tab in the upper right corner of your screen and uncheck the "Sidebar" option.
48
 
49
  == Screenshots ==
50
 
52
  2. The new sidebar shows up on the widget panel. Notice the new "Widget Area" widget for including other widget areas.
53
  3. Bulk edit in action. Easily assign a sidebar to multiple pages. (Quick edit works, too!)
54
 
55
+ == Notes ==
56
+
57
+ The philosphy behind creating this plugin was to make it easy to use and integrate it into the WordPress admin panel as seamlessly as possible. It's not the end-all, be-all solution for custom sidebars, but should handle the majority of use cases. We contemplated adding additional features and could have created an options page, but wanted to keep it simple and probably would have polluted it with credit meta boxes and whatnot.
58
+
59
+ The aim is basic, core-like functionality and integration.
60
+
61
+ = Custom Loops =
62
+
63
+ If your page has any custom loops or queries, they need to be followed by `wp_reset_query()`, otherwise the global `$post` variable will no longer reference the correct post and by the time the sidebar is displayed, Simple Page Sidebars won't know which page is being viewed, which can lead to an unexpected sidebar being displayed.
64
+
65
+ = Theme Sidebars =
66
+
67
+ Some themes create different sidebars for their various page templates, which means there isn't a default sidebar that can be replaced. The only workaround to continue using Simple Page Sidebars in this instance is to create a child theme to force page templates with custom sidebars to use the default sidebar.
68
+
69
  == Changelog ==
70
 
71
+ = 1.0 =
72
+ * Modified check for blog page.
73
+
74
  = 0.2.1 =
75
  * Now works for the blog page when it's set in the Reading Settings.
76
  * Bug fixes.
simple-page-sidebars.php CHANGED
@@ -1,11 +1,30 @@
1
  <?php
2
  /*
3
  Plugin Name: Simple Page Sidebars
4
- Version: 0.2.1
5
  Plugin URI: http://wordpress.org/extend/plugins/simple-page-sidebars/
6
  Description: Assign custom, widget-enabled sidebars to any page with ease.
7
  Author: Blazer Six, Inc.
8
  Author URI: http://www.blazersix.com/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  */
10
 
11
 
@@ -108,7 +127,7 @@ class Simple_Page_Sidebars {
108
  global $post;
109
 
110
  if ( is_page() || ( is_home() && $posts_page = get_option( 'page_for_posts' ) ) ) {
111
- $post_id = ( is_home() ) ? $posts_page : $post->ID;
112
 
113
  $custom_sidebar = get_post_meta( $post_id, '_sidebar_name', true );
114
  $default_sidebar_id = get_option( 'simple_page_sidebars_default_sidebar' );
1
  <?php
2
  /*
3
  Plugin Name: Simple Page Sidebars
4
+ Version: 1.0
5
  Plugin URI: http://wordpress.org/extend/plugins/simple-page-sidebars/
6
  Description: Assign custom, widget-enabled sidebars to any page with ease.
7
  Author: Blazer Six, Inc.
8
  Author URI: http://www.blazersix.com/
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ ------------------------------------------------------------------------
13
+ Copyright 2012 Blazer Six, Inc.
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation; either version 2 of the License, or
18
+ (at your option) any later version.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
  */
29
 
30
 
127
  global $post;
128
 
129
  if ( is_page() || ( is_home() && $posts_page = get_option( 'page_for_posts' ) ) ) {
130
+ $post_id = ( ! empty( $posts_page ) ) ? $posts_page : $post->ID;
131
 
132
  $custom_sidebar = get_post_meta( $post_id, '_sidebar_name', true );
133
  $default_sidebar_id = get_option( 'simple_page_sidebars_default_sidebar' );