Site logo

Archived topic

Content in the box

16 replies · Started by Sanu Kumar on September 25, 2020

Viewing posts 1–15 of 17

Hi there,

should be possible with some CSS - do you have a site setup where i can take a look at what needs to be done.

You can re-hook the header element to inside the content area using the filter provided here:

https://docs.generatepress.com/article/generate_page_hero_location/

Your code for single posts, placing the header element where the featured image is would look like this:

add_filter( 'generate_page_hero_location', function( $location ) {
    if ( is_single() ) {
        $location = 'generate_before_content';
    }

    return $location;
} );

I think we are a bit confused about what you are trying to achieve.

Are you basically wanting to have everything in a box? So like reduce the width of the current page hero?

There isn't anything special about that page.

Are you referring to the border and shadow etc?

Yes, I thought its a box.

Something like this?

.single .site.grid-container {
    border: 1px solid #e9e5e5;
    box-shadow: -19px -22px 49px -19px rgba(0,0,0,0.1);
}

Yes, it is good now but I want to modify it more like after applying this CSS, only content covered.

I want to take inside H1 with author name and Last Updated date + content area all should be in one.

yes I have figured it out but could you help me..there is no gap from the top..I want some gap between the header and border-top.

Try this CSS:

.single-post #page {
    margin-top: 40px;
}
/* Mobile spacing */
@media(max-width: 768px) {
    .single-post #page {
        margin-top: 20px;
    }
}
This archived topic is closed to new replies.