Skip to content

Commit

Permalink
Latest Posts: Use column class only for grid layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Soean authored and jorgefilipecosta committed Dec 29, 2017
1 parent 91dd36c commit eb1b301
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion blocks/library/latest-posts/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ class LatestPostsBlock extends Component {
</BlockControls>
),
<ul
className={ classnames( this.props.className, 'columns-' + columns, {
className={ classnames( this.props.className, {
'is-grid': layout === 'grid',
[ `columns-${ columns }` ]: layout === 'grid',
} ) }
key="latest-posts"
>
Expand Down
2 changes: 1 addition & 1 deletion blocks/library/latest-posts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function gutenberg_render_block_core_latest_posts( $attributes ) {
$class .= ' is-grid';
}

if ( isset( $attributes['columns'] ) ) {
if ( isset( $attributes['columns'] ) && 'grid' === $attributes['layout'] ) {
$class .= ' columns-' . $attributes['columns'];
}

Expand Down

0 comments on commit eb1b301

Please sign in to comment.