Site logo

Archived topic

padding on page title

14 replies · Started by DM on May 24, 2022

Viewing posts 1–15 of 15

Hi i want to move my page title over from the left margin, but I do not want to move the blog post page title over.

this css moves both over:

.entry-header {
padding-left: 25px;
}

Oops! sorry about that!

Thank you for adding the link to your site! You may try replacing your current CSS with this one:

.page .entry-header {
    padding-left: 25px;
}

Kindly let us know how it goes. :)

It's perfect! thanks!

You’re welcome DM! Glad that worked! :)

Hi there again!

I would like the title locations on my blog pages and archives to match the location on my pages. Links provided below. Can you advise how to get the blog post tile under the logo?

Thanks!
DM

Forgot to add, I do not want all the blog page titles moved over. Just the Archive category titles. Thanks!

I moved it over even with the page tilte using:

.category .page-header {
margin-left: -160px;
}

I now need to move it up and margin-top: -40px; is not working.

Hi there,

Instead of using negative margin CSS as that may cause you issues on smaller screens. Add this PHP Snippet:

add_action( 'wp', function() {
    remove_action( 'generate_archive_title', 'generate_archive_title' );
    add_action( 'generate_after_header', 'generate_archive_title' );
} );

How to add PHP: https://docs.generatepress.com/article/adding-php/

This should move the archive title in the HTML so its positioned just below the site header. There it will be part of the full width container so theres no need for negative margins.

Then we can use some CSS to adjust the page-header padding. Let me know

Hi there.
That, unfortunately, put the title "Archives" on every page even those with other content titles under the logo.

This worked:
add_action( 'wp', function() {
remove_action( 'generate_archive_title', 'generate_archive_title' );
if ( is_archive() && !is_author() ) {
add_action( 'generate_after_header', 'generate_archive_title' );
}
} );

Thanks for your help!

Doh... sorry about that.
Glad to hear you got it working !

Thanks for your help! :)

You're welcome :)

This archived topic is closed to new replies.