[Resolved] Move header above columns on category pages

Home Forums Support Move header above columns on category pages

  • This topic has 3 replies, 2 voices, and was last updated 9 months ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1108231
    Ryan

    On the category pages on my blog, I have a two column layout. It would be really nice if I could move the <header class=”page-header”> section to the top of the page outside of the columns. So the two column layout would only appear under the page header. In other words I need to move it first in the #content div. I know I could do this by finding the template file and editing it in my child theme. But I thought maybe you could give me a better way that wouldn’t cause problems if you make file changes in the future. Thanks for the help!

    #1108356
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    There’s a new hook in GP 2.4.0 we can use. Let’s try this:

    add_action( 'wp', function() {
        remove_action( 'generate_archive_title', 'generate_archive_title' );
    
        if ( is_archive() ) {
            add_action( 'generate_inside_site_container', 'generate_archive_title' );
        }
    } );
    #1108363
    Ryan

    Awesome, exactly what I wanted and so much easier then searching through template files like I started doing. I’m glad I asked!

    #1108986
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.