'."\n"; echo '

Add Widgets to Page

'."\n"; $names = get_option('addw2pdn'); $names = explode("|",$names); //remove spaces if ( isset($_POST['RemoveSpace'])) { foreach ( $names as $name ) { if ( preg_match("/\s/",$name) ) { $new_names .= str_replace(" ","_",$name); } else { $new_names .= $name; } $new_names .= "|"; } update_option('addw2pdn',$new_names); $names = explode("|",$new_names); } //delete widgets. if ( isset($_POST['Delete']) ) { foreach( $names as $name) { if ( $name != NULL ) $counts[] = $name; } echo "

Deleted"; foreach ( $counts as $delete ) { if ( !isset($_POST[$delete]) ) { $count[] = $delete; } else { echo " ".$delete; } } foreach ( $count as $subname ) { $new_names .= "|"; $new_names .= $subname; } update_option('addw2pdn',$new_names); echo ".

\n"; //end deliting } else { //count widget spaces foreach( $names as $name) { if ( $name != NULL ) $count[] = $name; } } $num = count($count); if ( $num <= 0 ) {//if no widget space echo '

To use this, add [addw2p name="name"] to eny entries. (please change the name) (by using a same name, you are able to show same widget space)

'."\n"; echo "

There is no widget settings.

\n"; return; } //if there is a widgetspace ?>

To use this, place a shortcode [addw2p name="name"] to eny entries. (replace 'name' with anyword of your choice)
WARNING: Please only use numbers and alphabet, do not use spaces. You will not be able to delete it with this plugin.
Bellow button'Replace spaces to under score' will change spaces to under score so you can delete it.

(By using a same name, you are able to show same widget space.)

This will create a new area on the widget page called addw2p - name where you can drag your widgets.
If nothing shows, please refresh the widgets page. Note: You may have to refresh several times, maybe even close the page and open it again.
Once the new area appears below sidebar, the plugin will be working.

To change the widgets that are showing, go to Appearance -> Widgets and edit the sidebar.

To delete it, check the names which you want to delete and press Delete button below.

There is widget settings.

"> '."\n"; echo ''."\n"; } ?>
'.$name.'

">

'1' ), $atts)); if ( $name == 1) return $content; $title = "addw2p-".$name; $names = get_option('addw2pdn'); $names = explode("|",$names); if( !in_array($name,$names) && $name != NULL ) { array_push($names,$name); foreach ($names as $subname ) { $new_names .= "|"; $new_names .= $subname; } update_option('addw2pdn',$new_names); } //show widgets ob_start(); echo '\n"; $myStr = ob_get_contents(); ob_end_clean(); return $myStr; } function addw2p_register_sidebar() { $names = get_option('addw2pdn'); $names = explode("|",$names); $num = count($names); if ( $num <= 0 ) { return; } foreach ( $names as $name ) { if ( $name != NULL ) { $title = "addw2p-".$name; register_sidebar(array( 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '', 'after_title' => '', 'name' => $title )); } } return; } add_action('wp_head','addw2p_css'); add_shortcode('addw2p','addw2p_register'); add_action('init','addw2p_register_sidebar'); if ( is_admin() ) add_action('admin_menu','addw2p_menu'); ?>