Cyber Week Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Move Archive Title + Description To Below Header

Home Forums Support Move Archive Title + Description To Below Header

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #166431
    Hftt

    Hi Tom

    How are you?

    Could you please show me how to move “Archive Title” and “Archive Description” from inside content container to below header area (generate_after_header)?

    Thanks you very much!

    #166525
    Tom
    Lead Developer
    Lead Developer

    Great question!

    Currently, this is very hard to do.

    However, I just made it so in the next update of GP, you’ll be able to do this with a simple piece of PHP.

    I’ll keep this unresolved and will come back once the new version is released to give you the code 🙂

    #166545
    Hftt

    Thank you so much!

    That will be wonderful. Please, please update it. I really couldn’t wait.

    #169297
    Hftt

    Hi Tom

    I updated GP to latest version 1.3.24. Can I move “Archive Title + Description” to “Below Header” in 1.3.24?

    Thanks much!

    #169372
    Tom
    Lead Developer
    Lead Developer

    Hi Paris,

    Awesome, let’s give it a try:

    add_action( 'after_setup_theme','generate_remove_archive_titles' );
    function generate_remove_archive_titles()
    {
        remove_action( 'generate_archive_title','generate_archive_title' );
    }
    
    add_action( 'generate_after_header','generate_add_archive_titles' );
    function generate_add_archive_titles()
    {
        if ( ! is_archive() )
            return;
        ?>
            <div class="page-header">
                <?php generate_archive_title(); ?>
            </div>
        <?php
    }

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    Let me know how it works out – might need some tweaking 🙂

    #169455
    Hftt

    Tom,

    Thank you so much for snippet. It does work! Beautifully.

    I wrap “generate_archive_title” with “grid-container” and add one more css class to tweak styles.

    Love GP and owe you a lot.

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