Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Commit

Permalink
Add a wrapper around the read more button and apply a 1em top margin (#…
Browse files Browse the repository at this point in the history
…1003)

* Add a wrapper around the read more button and apply a 1em top margin

* Set the read more button to be centered
  • Loading branch information
pattonwebz authored and Tammie Lister committed Nov 12, 2019
1 parent 26c5a22 commit 9ac5ba3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ function twentytwenty_block_editor_settings() {
* @return string $html
*/
function twentytwenty_read_more_tag( $html ) {
return preg_replace( '/<a(.*)>(.*)<\/a>/iU', sprintf( '<a$1><span class="faux-button">$2</span> <span class="screen-reader-text">"%1$s"</span></a>', get_the_title( get_the_ID() ) ), $html );
return preg_replace( '/<a(.*)>(.*)<\/a>/iU', sprintf( '<div class="read-more-button-wrap"><a$1><span class="faux-button">$2</span> <span class="screen-reader-text">"%1$s"</span></a></div>', get_the_title( get_the_ID() ) ), $html );
}

add_filter( 'the_content_more_link', 'twentytwenty_read_more_tag' );
Expand Down
8 changes: 8 additions & 0 deletions style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -2969,6 +2969,10 @@ h2.entry-title {
padding: calc(1.1em - 0.2rem) calc(1.44em - 0.2rem);
}

.read-more-button-wrap {
margin-top: 1em;
}

/* Block: Columns ---------------------------- */

.wp-block-columns.alignfull,
Expand Down Expand Up @@ -3421,6 +3425,10 @@ figure.wp-block-table.is-style-stripes {
margin-bottom: 0;
}

.read-more-button-wrap {
text-align: center;
}

.entry-content a:hover,
.entry-content a:focus {
text-decoration: none;
Expand Down
8 changes: 8 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2987,6 +2987,10 @@ h2.entry-title {
padding: calc(1.1em - 0.2rem) calc(1.44em - 0.2rem);
}

.read-more-button-wrap {
margin-top: 1em;
}

/* Block: Columns ---------------------------- */

.wp-block-columns.alignfull,
Expand Down Expand Up @@ -3443,6 +3447,10 @@ figure.wp-block-table.is-style-stripes {
margin-bottom: 0;
}

.read-more-button-wrap {
text-align: center;
}

.entry-content a:hover,
.entry-content a:focus {
text-decoration: none;
Expand Down

0 comments on commit 9ac5ba3

Please sign in to comment.