I cannot navigate between months on the widget calendar

WordPress Event Management, Calendars & Registration Forums General Question I cannot navigate between months on the widget calendar

This topic contains 4 replies, has 2 voices, and was last updated by  Stephen Harris 9 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10930

    Dear Stephen,

    next problem: I cannot navigate between months on the widget calendar .

    My Page: http://www.esistliebe.com

    I allready search for register_sidebar() in the function.php. But dont find the ‘before_widget’ part.

    Do you have any ideas?

    Manuel
    #10934

    Could you try adding the before_widget and after_widget arguments?

    register_sidebar(array(
       ...
      'before_widget' => '<div id="%1$s" class="widget %2$s">',
      'after_widget' => '</div>',
    ));
    Stephen Harris
    #10937

    Can only find this one:

    /* ————————————————————————-*
    * WIDGET COUNTER *
    * ————————————————————————-*/

    function widget_first_last_classes($params) {

    global $my_widget_num; // Global a counter array
    $this_id = $params[0]['id']; // Get the id for the current sidebar we're processing
    $arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets  
    
    if(!$my_widget_num) {// If the counter array doesn't exist, create it
        $my_widget_num = array();
    }
    
    if(!isset($arr_registered_widgets[$this_id]) || !is_array($arr_registered_widgets[$this_id])) { // Check if the current sidebar has no widgets
        return $params; // No widgets in this sidebar... bail early.
    }
    
    if(isset($my_widget_num[$this_id])) { // See if the counter array has an entry for this sidebar
        $my_widget_num[$this_id] ++;
    } else { // If not, create it starting with 1
        $my_widget_num[$this_id] = 1;
    }
    
    $class = 'class="widget-' . $my_widget_num[$this_id] . ' '; // Add a widget number class for additional styling options
    
    if($my_widget_num[$this_id] == 1) { // If this is the first widget
        $class .= 'first ';
    } elseif($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) { // If this is the last widget
        $class .= 'last ';
    }
    
    $params[0]['before_widget'] = str_replace('class="', $class, $params[0]['before_widget']); // Insert our new classes into "before widget"
    
    return $params;

    }

    in the other.php

    Manuel
    #11066

    andy ideas? 🙂

    Manuel
    #11108

    Is there no call to register_sidebar() anywhere?

    It looks like they are careful not to replace existing classes, so it must that when the theme calls register_sidebar() it’s not passing %1$s as the ID and %2$s as a class (which it does do by default).

    You could try setting the before_widget attribute in that above code (and in the classes the theme is tring to add).

    Stephen Harris
Viewing 5 posts - 1 through 5 (of 5 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.