Skip to content

Commit 3855177

Browse files
Make control respond better.
1 parent 97af779 commit 3855177

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

source/wp-content/themes/wporg-main-2022/src/remembers-list/index.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
namespace WordPressdotorg\Theme\Main_2022\Remembers_List_Block;
1010

11-
use function WordPressdotorg\MemorialProfiles\get_memorial_profiles;
12-
1311
add_action( 'init', __NAMESPACE__ . '\init' );
1412

1513
/**
@@ -39,11 +37,11 @@ function init() {
3937
*/
4038
function render( $attributes, $content, $block ) {
4139

42-
if ( ! function_exists( 'get_memorial_profiles' ) ) {
43-
return __( 'Memorial Profiles plugin is not active.', 'wporg' );
40+
if ( ! function_exists( '\WordPressdotorg\MemorialProfiles\get_profiles' ) ) {
41+
return __( 'Memorial Profiles mu-plugin is missing.', 'wporg' );
4442
}
4543

46-
$profiles = get_memorial_profiles();
44+
$profiles = \WordPressdotorg\MemorialProfiles\get_profiles();
4745

4846
$columns = $attributes['columns'];
4947
$group_count = ceil( count( $profiles ) / $columns );
@@ -55,7 +53,8 @@ function render( $attributes, $content, $block ) {
5553

5654
$block_content = '';
5755
foreach ( $groups as $group ) {
58-
$block_content .= '<!-- wp:columns --><div class="wp-block-columns">';
56+
// Set isStackedOnMobile to false so that the columns are not stacked on mobile. We override this in CSS to stack them.
57+
$block_content .= '<!-- wp:columns {"isStackedOnMobile":false} --><div class="wp-block-columns is-not-stacked-on-mobile">';
5958

6059
foreach ( $group as $profile ) {
6160
$block_content .= '<!-- wp:column --><div class="wp-block-column">';

source/wp-content/themes/wporg-main-2022/src/remembers-list/style.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@
88
text-decoration: underline;
99
}
1010
}
11+
12+
@media ( max-width: 500px) {
13+
.wp-block-wporg-remembers-list .wp-block-columns {
14+
flex-direction: column !important;
15+
}
16+
}

0 commit comments

Comments
 (0)