Site logo

[Resolved] page header title css help

Home Forums Support [Resolved] page header title css help

Home Forums Support page header title css help

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2069307
    johnaps

    Hello!

    i would like to position my page title on the start of the left sidebar and not on the start of the masonry-container.

    this will give you a picture
    https://ibb.co/2qVjZjg

    whatever css i came up with was faulty…

    Have you stumbled on this before? If so can you please help me out, with the correct way to do this?

    If css isnt the best option, is there a way to output the
    <header class="page-header" aria-label="Page">
    outside and before the <div class="site-content" id="content">?

    #2069312
    Ying
    Staff
    Customer Support

    Hi John,

    Try this PHP snippet:

    add_action( 'after_setup_theme', function() {
        remove_action( 'generate_archive_title', 'generate_archive_title' );
    } );
    
    add_action ('generate_inside_site_container', 'generate_archive_title');
    #2069733
    johnaps

    Thank you very much!!!

    #2070566
    Ying
    Staff
    Customer Support

    No problem 🙂

    #2071056
    johnaps

    Hello again!

    I think there are some further issues i need help with the above solution!

    In my search results pages the page-header is added 2 times
    https://thefinterest.kinsta.cloud/?s=j

    In the new position set and in the old one.

    Also the new header in search results page is showing “Archives” instead of “Search Results”.

    And lastly in my homepage a new header appeared with the name “archives”, which wasnt there before and isnt necessary i believe.
    https://thefinterest.kinsta.cloud/

    Can you help me fix this?

    #2071682
    johnaps

    Also in my posts the header appears a second time before content and i dont want it…
    https://thefinterest.kinsta.cloud/p/uncategorized/asjalska/

    #2071823
    Ying
    Staff
    Customer Support

    I see, try this one so that the archive title will only be removed and re-added to the archive pages:

    add_action( 'after_setup_theme', function() {
        remove_action( 'generate_archive_title', 'generate_archive_title' );
    } );
    
    add_action ('wp', function() {
        if ( is_archive() ) {
            add_action ('generate_inside_site_container', 'generate_archive_title');
        }
    } );
    #2072216
    johnaps

    it is almost perfect!

    i want to apply that in search results pages also
    example: https://thefinterest.kinsta.cloud/?s=df

    i want the header above site-content in search results as well

    #2072939
    Ying
    Staff
    Customer Support
    #2073158
    johnaps

    okay thank you, that worked, but i added it as a hook not a header!! 🙂

    #2073609
    Ying
    Staff
    Customer Support

    Glad it worked 🙂

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