Update to read more link location
-
I have been trying to get Subversion to work, but for some reason it doesn’t like my login credentials 🙁
I had changed the file
class/advanced-excerpt.php from line 431 to$allow_tags_to_append_into = apply_filters( 'advanced_excerpt_allow_tags_to_append_into', array( 'p', 'article', 'section' ) ); if( !in_array( $last_tag, $allow_tags_to_append_into ) ) { // After the content $block_level_tags = apply_filters( 'advanced_excerpt_block_level_tags', array( 'blockquote', 'div', 'ul', 'ol', 'li', 'table', 'dl', 'dd', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'figure', 'figcaption', 'aside', 'header', 'footer', 'main', 'details', 'dialog', 'address', 'fieldset', 'form', 'nav', 'section' ) ); if ( in_array( $last_tag, $block_level_tags ) ) { $text .= '<p class="excerpt-read-more">' . trim( $ellipsis ) . '</p>'; } else { // After the content $text .= $ellipsis; } return $text; } // Inside last HTML tag $text = substr_replace( $text, $ellipsis, $pos, 0 ); return $text; } // After the content $text .= $ellipsis; return $text; }This solves the problem where where read more links land in a post container outside of paragraph if excerpt ends with a closing tag other than p/article/selection. This means that the read more link is not always aligned with the preceding container and can be far on the left. Adding ‘blockquote’ to the whitelist doesn’t work because then the read more link appears inside the blockquote.
Best!
You must be logged in to reply to this topic.