Site logo

Archived topic

Top Section Customisation and Blog Customisation

14 replies · Started by Osman on April 5, 2020

Viewing posts 1–15 of 15

Hi,

I LOVE the GeneratePress theme especially the speed!

I am looking to customise the aesthetics of this theme.

Firstly, I want to change the top section of post, blog and pages to look like the following website:

https://backlinko.com/keyword-research (Article page) - Blend page title with image
https://backlinko.com/content-marketing-tips (Article page) - Blend page title with image
https://backlinko.com/blog (Blog page) - Add optin at top

Can someone please get back to me.

thanks

If we can help tackle one of them to begin with:
https://backlinko.com/keyword-research-tool-analysis

1. Add this PHP snippet to your site:

function db_feat_img_shortcode() {
    $img_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large', false );
	return '<img src="' . $img_src[0] . '"/>';
}
add_shortcode( 'db_feat_img', 'db_feat_img_shortcode' );

https://docs.generatepress.com/article/adding-php/

2.Configure the Header Element as per this example:
https://docs.generatepress.com/article/page-hero-examples/#example-2

Change the Background Image to none, and give it a background color.
Then below the last line of content add this shortcode:

[db_feat_img]

Hi David,

It's getting there - just need a few tweaks to look like this:
https://backlinko.com/content-marketing-tips

Ive decided this is the template i want my posts to look like

I would appreciate your help to make it look like this

Thanks

Edit the Header element and:
1. in Element Classes add: post-hero
2. give it 65px of Top Padding.

Then add this CSS:

.post-hero time + img {
    display: block;
    border-radius: 8px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 40px;
    margin-bottom: -160px !important;
}

.post-hero + #page {
    padding-top: 140px;
}

Hi

It's getting there - The background colour (purple) shouldn't be the same height as image - I want it to be half way in the middle of the image like:

https://backlinko.com/content-marketing-tips

Is this possible?

Hi David

Thank you so much!

Quick follow up question:

How do I get the following to be on one line in mobile:
[page_hero_gravatar] {{post_author}} {{post_date}}

Edit the Header Element, next to padding you can select Mobile - reduce the left and right to 10px to give it more space, then add this CSS:

@media (max-width: 500px) {
    .page-hero span, .page-hero time {
        font-size: 14px;
    }
}

Genius!

Thanks

Glad to be of help

This archived topic is closed to new replies.