• Resolved inula

    (@janetb)


    Hi Tom,

    Used GeneratePress more than once and I think it’s a great, flexible theme!
    Now I would like to use the Featured Image to show a screenwide image above the content.
    Therefor I removed “grid-container grid-parent” out of the sentence <div class="<?php echo $class; ?> grid-container grid-parent"> in function generate_featured_page_header_area($class)

    The picture is screenwide now, just as I wanted.

    The hook for this function is <?php do_action( ‘generate_after_header’ ); ?>
    That hook also calls the navigation and af course before it calls the Featured Image

    Waht I would like to know is how I can change the order of those two functions in that hook (and where I can find that).

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    You can change the priority of the function.

    For example:

    add_action( 'after_setup_theme','tu_move_page_header' );
    tu_move_page_header()
    {
        remove_action('generate_after_header','generate_featured_page_header', 10);
        add_action('generate_after_header','generate_featured_page_header', 4);
    }

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

    Let me know if you need more info ??

    Thread Starter inula

    (@janetb)

    Hi Tom,

    Thanks for your answer. I made a plugin and put the lines you mentioned in it.
    That’s not quite what you mean I guess, because I got a fatal error…

    <?php
    /*
    Plugin Name: Uitgelichte afbeelding boven menu
    Plugin URI: 
    Description: 
    Version: 
    Author: 
    Author URI: 
    License: 
    License URI: 
    */
    
    add_action( 'after_setup_theme','tu_move_page_header' );
    tu_move_page_header()
    {
        remove_action('generate_after_header','generate_featured_page_header', 10);
        add_action('generate_after_header','generate_featured_page_header', 4);
    }
    
    ?>
    • This reply was modified 8 years, 1 month ago by inula.
    Theme Author Tom

    (@edge22)

    Ugh sorry about that – need more coffee apparently.

    Try this:

    add_action( 'after_setup_theme','tu_move_page_header' );
    function tu_move_page_header()
    {
        remove_action('generate_after_header','generate_featured_page_header', 10);
        add_action('generate_after_header','generate_featured_page_header', 4);
    }
    Thread Starter inula

    (@janetb)

    Thanks Tom.
    Give a big hug from me to that little boy(?) in your arms.
    Have a nice day (overhere the day almost ends).

    Theme Author Tom

    (@edge22)

    You’re welcome.

    I will! Little girl, difficult to tell from the photo ??

    Have a great night! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Order in hook: generate_after_header’ is closed to new replies.