wpsmith / genesis-sandbox-featured-content-widget

Genesis Sandbox Featured Content Widget. Based on Nick Croft's Genesis Featured Widget Amplified for additional functionality which allows support for custom post types, taxonomies, and extends the flexibility of the widget via action hooks to allow the elements to be re-positioned or other elements to be added.
39 stars 21 forks source link

<article> hook #49

Closed simbasounds closed 9 years ago

simbasounds commented 9 years ago

I'm using this technique to create justified blocks: http://www.barrelny.com/blog/text-align-justify-and-rwd/

In order to apply it to the plugin's output I need to insert a space after , but I don't think there's a hook for that.

wpsmith commented 9 years ago

No, that's not needed. You can hook into the post_class filter and use the $gs_counter to determine which number you are on and add your own class for breakage. So assuming you want to break on the 4th one, it would be something like this:

add_filter( 'post_class', 'prefix_post_class' );
function prefix_post_class( $classes ) {
    global $gs_counter;
    $classes[] = ( $gs_counter + 1 ) % 4 ? 'break';
    return $classes;
}