Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • It looks like the Twitter @anywhere iframes are causing the scrollbars.

    With Firebug I applied display: none to the iframes and the scrollbars disappeared. However they are generated with Twitter’s @anywhere JavaScript, so I’m not sure if _twttr_anywhere_client_1 will always remain the CSS ID for the iframe element(s, since I see 2 of them in Firebug).

    HTH

    I like to nitpick on my formatting: although the function code is readable and parseable by PHP I’m going to paste it again…

    function my_widget_class($params) {
    	global $widget_num;
    
    	// Widget class
    	$class = array();
    	$class[] = 'widget';
    
    	// Iterated class
    	$widget_num++;
    	$class[] = 'widget-' . $widget_num;
    
    	// Alt class
    	if ($widget_num % 2) :
    		$class[] = 'insert-odd';
    	else :
    		$class[] = 'insert-even';
    	endif;
    
    	// Join the classes in the array
    	$class = join(' ', $class);
    
    	// Interpolate the 'my_widget_class' placeholder
    	$params[0]['before_widget'] = str_replace('my_widget_class', $class, $params[0]['before_widget']);
    	return $params;
    }

    I’m wondering if there’s some kind of filter I’m overlooking that would handle this.

    I worked it out: it’s the dynamic_sidebar_params filter. Change your function to the following:


    function my_widget_class($params) {
    global $widget_num;

    // Widget class
    $class = array();
    $class[] = 'widget';

    // Iterated class
    $widget_num++;
    $class[] = 'widget-' . $widget_num;

    // Alt class
    if ($widget_num % 2) :
    $class[] = 'insert-even';
    else :
    $class[] = 'insert-odd';
    endif;

    // Join the classes in the array
    $class = join(' ', $class);

    // Interpolate the 'my_widget_class' placeholder
    $params[0]['before_widget'] = str_replace('my_widget_class', $class, $params[0]['before_widget']);
    return $params;
    }

    (I fixed the confusion between odd and even, BTW.)

    Your function is actually being called within register_sidebar(), so there isn’t any loop involved. We’ll use a placeholder CSS class called ‘my_widget_class’ instead. Change the ‘before_widget’ string to:


    'before_widget' => '<div id="%1$s" class="%2$s my_widget_class">',

    Then add this to the dynamic_sidebar_params filter:


    add_filter('dynamic_sidebar_params', 'my_widget_class');

    I tried it on my theme and it works flawlessly. For multiple sidebars, though, $widget_num will continue to increment instead of resetting at the first widget of a different sidebar.

    Since you only have one sidebar, that shouldn’t be a problem. Let me know if you have any issues with this.

    Thread Starter Daniel Tan

    (@boltclock)

    Ah, I see. No wonder pingbacks are so much more common, and pingback comment content contains the very link to posts.

    Thanks for clearing this up!

    Thread Starter Daniel Tan

    (@boltclock)

    I think it might be because of Google Analytics because I see something like

    <p><a href="[post permalink]/#more-371" class="more-link" onclick="javascript:urchinTracker ('/outbound/article/blog.NOVALISTIC.com');">(more…)</a></p>

    in the source. Posts still get cut off after the more link.

    Thread Starter Daniel Tan

    (@boltclock)

    The RSS feed doesn’t appear to contain comments for posts and I see the more link despite telling WordPress to display full posts in feeds. What should I do?

    Thread Starter Daniel Tan

    (@boltclock)

    Hmmm, feeds… yeah I didn’t know there are category feeds. Thanks!

    Thread Starter Daniel Tan

    (@boltclock)

    Ah, I was wondering what filters were for. Thanks! I’ve set a filter and I’ll see how things go.

    @mendezki: I don’t use Ultimate Google Analytics :/

    I did exactly that when upgrading to 2.2.2. Really saves the hassle since I didn’t modify any of the core files.

    Better watch out people. In each release, files don’t just get added and modified. They also get deleted.

    I’ll keep that in mind, I believe the ChangeLog will tell us which files get deleted too ??

    Thread Starter Daniel Tan

    (@boltclock)

    Hey thanks, apparently I told FileZilla to only overwrite files if newer instead of always, so the first transfer could’ve messed up and FZ would’ve refused to overwrite on the second upload.

    WP is now upgraded!

    Daniel Tan

    (@boltclock)

    I’m from Singapore ??

Viewing 11 replies - 1 through 11 (of 11 total)