Black Friday sale! Get up to 25% off GP Premium! Learn more ➝

[Support request] Remove (Not Hide) Post Title In Archive / Home – To Display Only Featured Images

Home Forums Support [Support request] Remove (Not Hide) Post Title In Archive / Home – To Display Only Featured Images

Home Forums Support Remove (Not Hide) Post Title In Archive / Home – To Display Only Featured Images

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #992023
    Jose

    Hey I’m trying to remove the post title and remove the whitespace under the featured image… for archive / blog page β†’ https://eqor.is/IUAU6J

    Okay, what would be ideal is to remove the whitespace, and have the title fit as an overlay on the featured image/thumbnail. We run a food blog, so pictures are the main thing….

    #992417
    Tom
    Lead Developer
    Lead Developer

    In order to actually remove those titles, you would need to copy the content.php file and add it to your child theme.

    Then you’d remove this line: https://github.com/tomusborne/generatepress/blob/2.3.2/content.php#L34

    It should also be possible to overlay it over the image. Any chance you can link us to that page?

    #992562
    Jose

    Decided not to remove the titles, but keep them like in https://wplift.com/ – but how do you fix the image size, and reduce the spacing?

    Unfortunately, its being setup on MAMP before we test it live.

    #992566
    Jose

    Tom,

    I think I used this code before on Genesis, would this work on GP?

    function be_remove_post_title_in_grid() {
    	if( ! apply_filters( 'is_genesis_grid_loop', false ) )
    		return;	
    	if( in_array( 'teaser', get_post_class() ) ) {
    		remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    	    add_action( 'genesis_entry_content', 'genesis_do_post_title' );
    	}
    	
    }
    add_action( 'genesis_before_entry', 'be_remove_post_title_in_grid' );
    #992640
    Leo
    Staff
    Customer Support

    You can set the image sizing and remove the padding around the image in the customizer:
    https://docs.generatepress.com/article/adjusting-the-featured-images/

    Then you should get something like this:
    https://www.screencast.com/t/xON1w8mXYzbh

    And no that code won’t work for GP. The only solution to remove post title is the method Tom indicated above.

    Let me know πŸ™‚

    #992669
    Jose

    Hi Leo, I tried setting the height to 600 and width to auto, but there seems to be some problem with alignment… if the height is the same, shouldnt GP automatically resize width? please see https://eqor.is/WauChY

    #993067
    Tom
    Lead Developer
    Lead Developer

    Hmm, that should in theory as long as the resizer is working. Is there any way for us to actually see the site?

    Does it work if you define a width as well?

    #993940
    Jose

    Tom, just uploaded to the site which is live now β†’ https://mariasmenu.com/ – could you please look.

    #993969
    Leo
    Staff
    Customer Support

    Any chance you can clear and disable all caching plugins and image lazy load plugins first?

    I think the issue here is that when 600px is set to be the height, the (auto) widths of the images combined together is larger than the container width of 1030px.

    What if you set the height to be smaller like 400px? do the images line up correctly?

    Let me know πŸ™‚

    #993981
    Jose

    If the height is set to 400, white space shows up on the left and right… https://eqor.is/8ehegC

    #993986
    Jose

    Also, on mobile with a lower height than 600, the image is much smaller, creating more white space… https://eqor.is/wu6PmY

    #993998
    Leo
    Staff
    Customer Support

    Are you able to upload the featured images so they are all the same size to start with?

    That’s generally what I would recommend. Then you don’t have to deal with the cropping/resizing issue.

    Let me know πŸ™‚

    #994004
    Jose

    Leo, we have over 500 posts… that’s not going to be a solution for us.

    #994176
    Tom
    Lead Developer
    Lead Developer

    What if you do something like this?:

    .post-image img {
        width: 100%;
    }
    
    @media (min-width: 769px) {
        .post-image img {
            height: 400px;
            object-fit: cover;
        }
    }
    #994276
    Jose

    Thanks Tom! That seems to have done the trick… https://eqor.is/lrtTPc

    On a tablet view however, there is a lot whitespace around the image… https://eqor.is/UZVgxw I believe this is from the post container, how do you make that fit the image and center align?

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