[Resolved] Can I achieve this layout?

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Can I achieve this layout?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31717
    Greg
    Participant

    I’m trying to achieve a post list like this.

    Post layout

    The base card has the title, except & read more button below the image. The overlay card has everything over the image. I’d like the title over the image and the excerpt & read more below. Is there any way to achieve this?

    #31725
    elvin
    Moderator

    Hi there,

    You’ll have to do a bit of customization with PHP filters to do this.

    Untick Include title and add this PHP snippet.

    add_action('wpsp_inside_image_container', function($settings){
    	
    	$before_title = sprintf(
    		'<%1$s class="wp-show-posts-entry-title" itemprop="headline"><a href="%2$s" rel="bookmark">',
    		$settings[ 'title_element' ],
    		esc_url( get_permalink() )
    	);
    
    	$after_title = '</a></' . $settings[ 'title_element' ] . '>';
    	
    	echo the_title( $before_title, $after_title );
    });

    You then add this CSS:

    .wp-show-posts-image.wpsp-image-center h2.wp-show-posts-entry-title {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
    }
    #31746
    Greg
    Participant

    Perfect starting point. Thank you, I’ve got it working now.

    #31755
    elvin
    Moderator

    Nice one. Glad you got it sorted. 😀

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