New GK Grid IV widget area

Premium BuddyPress WordPress theme perfect for venue, music brand or community music website.
GK User
Sat May 17, 2014 1:53 pm
How can I add additional "GK Grid IV" widget area in Appearance/Widgets?
Widgets.JPG
User avatar
Fresh Boarder

GK User
Sat May 17, 2014 2:24 pm
I've changed the value of the variable $amount_of_sidebars from 0 to 4 in the plugin/gk-grid/gk-grid.php (row 193) and that helped :)

Was the decision correct? :)

Code: Select all
static function register_sidebars() {
      $option = get_option('widget_gk_grid');
      $amount_of_sidebars = 4; /* $amount_of_sidebars = 0; */
      if(is_array($option) && count($option) > 0) {
         foreach($option as $grid_widget_instance) {
            if($grid_widget_instance['amount_of_sidebars'] > $amount_of_sidebars) {
               $amount_of_sidebars = $grid_widget_instance['amount_of_sidebars'];
            }
         }
      } else {
         $amount_of_sidebars = 3;
      }
      // use the value for generating new sidebars
      for($i = 1; $i <= $amount_of_sidebars; $i++) {
         register_sidebar(
            array(
               'name'          => 'GK Grid ' . GK_Grid_Widget::roman_number($i),
               'id'            => 'gk-grid-sidebar-' . $i,
               'description'   => '',
                 'class'         => '',
               'before_widget' => '',
               'after_widget'  => '',
               'before_title'  => '',
               'after_title'   => ''
            )
         );
      }
   }
User avatar
Fresh Boarder

GK User
Sun May 18, 2014 9:41 pm
Hello,

Yes, you can change it directly in the code, but in the GK Grid Settings, there's an option "Amount of sidebars", you can just type amount, save the widget, refresh the page and you should see more GK Grid widget areas, there's no need to edit the code.
User avatar
Moderator

GK User
Tue May 20, 2014 11:04 pm
Thanks! Your way is better! :)
User avatar
Fresh Boarder


cron