Skip to content

Commit

Permalink
Merge pull request #4202 from WordPress/update/latest-posts-list-columns
Browse files Browse the repository at this point in the history
Latest Posts: Use `columns-x` class only for grid layout
  • Loading branch information
Soean authored Jan 10, 2018
2 parents af8826b + eb1b301 commit 213c64b
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 @@ -127,8 +127,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 213c64b

Please sign in to comment.