From 55c709dbc90ef65a318c051c3a1f0333e4bf0f19 Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Fri, 28 Feb 2020 20:15:38 +0200 Subject: [PATCH 1/2] fixes the read more added by themes in latest posts block rendering --- .../block-library/src/latest-posts/index.php | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/packages/block-library/src/latest-posts/index.php b/packages/block-library/src/latest-posts/index.php index 6e96f10461231..4e9571663612b 100644 --- a/packages/block-library/src/latest-posts/index.php +++ b/packages/block-library/src/latest-posts/index.php @@ -33,7 +33,11 @@ function block_core_latest_posts_get_excerpt_length() { * @return string Returns the post content with latest posts added. */ function render_block_core_latest_posts( $attributes ) { +<<<<<<< HEAD global $block_core_latest_posts_excerpt_length; +======= + global $post; +>>>>>>> fixes the read more added by themes in latest posts block rendering $args = array( 'posts_per_page' => $attributes['postsToShow'], @@ -55,6 +59,7 @@ function render_block_core_latest_posts( $attributes ) { $list_items_markup = ''; foreach ( $recent_posts as $post ) { + $list_items_markup .= '
  • '; if ( $attributes['displayFeaturedImage'] && has_post_thumbnail( $post ) ) { @@ -108,21 +113,9 @@ function render_block_core_latest_posts( $attributes ) { $trimmed_excerpt = get_the_excerpt( $post ); $list_items_markup .= sprintf( - '
    %1$s', + '
    %1$s
    ', $trimmed_excerpt ); - - if ( strpos( $trimmed_excerpt, ' … ' ) !== false ) { - $list_items_markup .= sprintf( - '%2$s
    ', - esc_url( get_permalink( $post ) ), - __( 'Read more' ) - ); - } else { - $list_items_markup .= sprintf( - '' - ); - } } if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent'] From f08af5c31c35fc72d2e6e34dd07d766a38c0285c Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Sun, 8 Mar 2020 14:55:08 +0200 Subject: [PATCH 2/2] fix mistaken rebase --- packages/block-library/src/latest-posts/index.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/block-library/src/latest-posts/index.php b/packages/block-library/src/latest-posts/index.php index 4e9571663612b..3d9047f1eb18b 100644 --- a/packages/block-library/src/latest-posts/index.php +++ b/packages/block-library/src/latest-posts/index.php @@ -33,11 +33,7 @@ function block_core_latest_posts_get_excerpt_length() { * @return string Returns the post content with latest posts added. */ function render_block_core_latest_posts( $attributes ) { -<<<<<<< HEAD - global $block_core_latest_posts_excerpt_length; -======= - global $post; ->>>>>>> fixes the read more added by themes in latest posts block rendering + global $post, $block_core_latest_posts_excerpt_length; $args = array( 'posts_per_page' => $attributes['postsToShow'],