Site logo

[Resolved] Can’t get buttons to stick to bottom in query loop + button width

Home Forums Support [Resolved] Can’t get buttons to stick to bottom in query loop + button width

Home Forums Support Can’t get buttons to stick to bottom in query loop + button width

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #2554559
    paddyd

    I knew there had to be a reason that “is_home” was in there…and there is. Two read more buttons everywhere on the home page, without it. LOL. Always something.

    SO…the PHP code that works is:

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

    And the CSS to make it all happen:

    .gb-inside-container {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    .gb-inside-container > *:last-child {
        margin-top: auto;
    }
    .generate-columns .inside-article {
        display: flex;
        flex-direction: column;
    	height: 100%;
    }
    
    .generate-columns .inside-article .entry-summary {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }
     .read-more-container {
        margin-top: auto;
    }

    An interesting lesson in how *sometimes* someone else’s code isn’t quite what is needed. Or something like that. 😉 Anyway – thanks for seeing this through. Now back to converting WP Show Posts sites…

    #2554624
    Ying
    Staff
    Customer Support

    haha glad it’s working now 🙂

    That’s why we ask for users’ sites, as everyone’s site has some different something.

Viewing 2 posts - 16 through 17 (of 17 total)
  • You must be logged in to reply to this topic.