Version Description
Download this release
Release Info
Developer | toddhalfpenny |
Plugin | Widgets on Pages |
Version | 0.0.1 |
Comparing to | |
See all releases |
Version 0.0.1
- readme.txt +44 -0
- widgets_on_pages.php +52 -0
readme.txt
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Widgets on Pages ===
|
2 |
+
Contributors: toddhalfpenny
|
3 |
+
Donate link: n/a
|
4 |
+
Tags: widgets, sidebar, pages, post
|
5 |
+
Requires at least: 2.8
|
6 |
+
Tested up to: 2.9.1
|
7 |
+
Stable tag: 0.0.1
|
8 |
+
|
9 |
+
Allows 'in-page' widget areas so widgets can be defined via shortcut straight into page/post content
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
Allows 'in-page' widget areas so widgets can be defined via shortcut straight into page/post content
|
14 |
+
|
15 |
+
|
16 |
+
== Installation ==
|
17 |
+
|
18 |
+
|
19 |
+
1. Upload the directory `widgets-on-pages` and all its contents to the `/wp-content/plugins/` directory
|
20 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
21 |
+
1. Add the following lines to the end of your themes `functions.php` file
|
22 |
+
`<pre><?php if ( function_exists('register_sidebar') )
|
23 |
+
register_sidebar(array(
|
24 |
+
'name' => 'Widgets on Pages',
|
25 |
+
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
26 |
+
'after_widget' => '</li>',
|
27 |
+
'before_title' => '<h2 class="widgettitle">',
|
28 |
+
'after_title' => '</h2>',
|
29 |
+
)); ?></pre>`
|
30 |
+
1. Add the shortcut `[widgets_on_pages]` to the page or post in the place where you'd like your widgets to appear.
|
31 |
+
1. Add the widgets you want to the `Widgets on Pages` widget area in the admin screens
|
32 |
+
|
33 |
+
|
34 |
+
== Frequently Asked Questions ==
|
35 |
+
|
36 |
+
= Can I have more than one defined sidebar area =
|
37 |
+
|
38 |
+
No, sorry not yet. The plan is to get this supported though
|
39 |
+
|
40 |
+
== Changelog ==
|
41 |
+
|
42 |
+
= 0.0.1 =
|
43 |
+
|
44 |
+
1st release - only supports one defined in-post/page widget area
|
widgets_on_pages.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* Copyright 2010 TODD HALFPENNY (email : todd@gingerbreaddesign.co.uk)
|
4 |
+
|
5 |
+
This program is free software; you can redistribute it and/or modify
|
6 |
+
it under the terms of the GNU General Public License as published by
|
7 |
+
the Free Software Foundation; either version 2 of the License, or
|
8 |
+
(at your option) any later version.
|
9 |
+
|
10 |
+
This program is distributed in the hope that it will be useful,
|
11 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
GNU General Public License for more details.
|
14 |
+
|
15 |
+
You should have received a copy of the GNU General Public License
|
16 |
+
along with this program; if not, write to the Free Software
|
17 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
18 |
+
*/
|
19 |
+
|
20 |
+
/*
|
21 |
+
Plugin Name: Widgets on Pages
|
22 |
+
Plugin URI: http://gingerbreaddesign.co.uk/wordpress/plugins/widgets-on-pages.php
|
23 |
+
Description: Allows 'in-page' widget areas so widgets can be defined via shortcut straight into page/post content
|
24 |
+
Author: Todd Halfpenny
|
25 |
+
Version: 0.0.1
|
26 |
+
Author URI: http://gingerbreaddesign.co.uk/todd
|
27 |
+
*/
|
28 |
+
|
29 |
+
|
30 |
+
/* ===============================
|
31 |
+
C O R E C O D E
|
32 |
+
================================*/
|
33 |
+
|
34 |
+
|
35 |
+
function widgets_on_page(){
|
36 |
+
$str = "<div id='widgets_on_page'>
|
37 |
+
<ul>";
|
38 |
+
ob_start();
|
39 |
+
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Widgets on Pages") ) :
|
40 |
+
endif;
|
41 |
+
$myStr = ob_get_contents();
|
42 |
+
ob_end_clean();
|
43 |
+
$str .= $myStr;
|
44 |
+
$str .= "</ul>
|
45 |
+
</div><!-- widget_on_page -->";
|
46 |
+
return $str;
|
47 |
+
}
|
48 |
+
|
49 |
+
add_shortcode('widgets_on_pages', 'widgets_on_page');
|
50 |
+
|
51 |
+
|
52 |
+
?>
|