Home › Forums › Support › Remove (Not Hide) Post Title In Archive / Home – To Display Only Featured Images
- This topic has 17 replies, 4 voices, and was last updated 4 years, 8 months ago by David.
-
AuthorPosts
-
August 23, 2019 at 10:10 pm #992023Jose
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….
August 24, 2019 at 9:50 am #992417TomLead DeveloperLead DeveloperIn 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?
August 24, 2019 at 3:22 pm #992562JoseDecided 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.
August 24, 2019 at 3:25 pm #992566JoseTom,
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' );
August 24, 2019 at 8:47 pm #992640LeoStaffCustomer SupportYou 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/xON1w8mXYzbhAnd no that code won’t work for GP. The only solution to remove post title is the method Tom indicated above.
Let me know π
August 24, 2019 at 11:15 pm #992669JoseHi 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
August 25, 2019 at 9:27 am #993067TomLead DeveloperLead DeveloperHmm, 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?
August 26, 2019 at 9:28 am #993940JoseTom, just uploaded to the site which is live now β https://mariasmenu.com/ – could you please look.
August 26, 2019 at 10:09 am #993969LeoStaffCustomer SupportAny 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 of1030px
.What if you set the height to be smaller like
400px
? do the images line up correctly?Let me know π
August 26, 2019 at 10:24 am #993981JoseIf the height is set to 400, white space shows up on the left and right… https://eqor.is/8ehegC
August 26, 2019 at 10:28 am #993986JoseAlso, on mobile with a lower height than 600, the image is much smaller, creating more white space… https://eqor.is/wu6PmY
August 26, 2019 at 10:51 am #993998LeoStaffCustomer SupportAre 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 π
August 26, 2019 at 11:03 am #994004JoseLeo, we have over 500 posts… that’s not going to be a solution for us.
August 26, 2019 at 4:13 pm #994176TomLead DeveloperLead DeveloperWhat if you do something like this?:
.post-image img { width: 100%; } @media (min-width: 769px) { .post-image img { height: 400px; object-fit: cover; } }
August 26, 2019 at 10:17 pm #994276JoseThanks 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?
-
AuthorPosts
- You must be logged in to reply to this topic.