Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Read More button same height

  • omp-generatepress

    Hi.

    Right now I develop on localhost.
    I have the following function to trim the excerpt and to rename the “Read More” button:

    add_filter( 'wp_trim_excerpt', function( $excerpt ) {
    	if ( is_home() || is_archive() ) {
            return sprintf( '%1$s <p class="read-more-button-container"><a class="button" href="%2$s">%3$s</a></p>',
                $excerpt,
                get_permalink(),
                __( 'Visit Gallery', 'generatepress' )
            );
        }
        return $excerpt;
    });

    The only problem is that not all of the buttons are on the same height, depending on the length of the excerpt.

    Button

    How can I ensure that the buttons are all at the same height? Do I have to add some extra CSS to the class=“entry-summary” or to the class=”read-more-button-container”?

  • Hi there,

    It requires CSS.

    Try this CSS:

    :is(.blog, .archive) .inside-article, .entry-summary {
        display: flex;
        flex-direction: column;
    }
    
    :is(.blog, .archive) .entry-summary {
        flex-grow: 1;
    }
    
    :is(.blog, .archive) p.read-more-container {
        margin-top: auto;
    }

    if it doesn’t work, I would need to see your site to know the exact the structure and write CSS based on that.

    Let me know 🙂

  • omp-generatepress

    No, that CSS code doesn´t work. It has no effect on the entry-summary container.
    Right now I can´t show you my site, because I develop on localhost.

  • Let me know when it’s online.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.