[Resolved] Showing featured image before Menu

Home Forums Support [Resolved] Showing featured image before Menu

Home Forums Support Showing featured image before Menu

  • This topic has 13 replies, 3 voices, and was last updated 6 years ago by Tom.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #538406
    Daniel

    Hi there

    i want to show the featured image and sliders before the main menu… so on my homepage i did this with the wp hook in the “before header” section like this

    <?php if (is_front_page()) : ?>
    [rev_slider alias=”home”]
    <?php endif; ?>

    worked fine… but whats the best way tho show the featured image on all pages before the main menu? I couldnt find this option in the Customizer section so i guess i have to use the header hook as well?

    thanks for help

    #538795
    Leo
    Staff
    Customer Support
    #539356
    Daniel

    worked πŸ™‚

    thanks

    #539898
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

    #542203
    Daniel

    ah sorry to bother you again but is there a way to make the featured image parallax?

    thanks for help

    #542470
    Leo
    Staff
    Customer Support

    Not unless you use the page header with it: https://docs.generatepress.com/article/page-header-content/#parallax-effect

    If you need more info, can you open a new topic?

    Thanks!

    #542806
    Daniel

    yeah but this does not work because i use the featured image… the header is below my featured image because of this code

    add_action( ‘wp’, ‘tu_move_featured_image’, 60 );
    function tu_move_featured_image() {
    remove_action( ‘generate_after_header’, ‘generate_blog_single_featured_image’ );
    add_action( ‘generate_after_header’, ‘generate_blog_single_featured_image’, 4 );
    }

    So the header section does not really effect my featured image… is there jsut a simple solution to make every featured image parralax?

    thanks

    #543094
    Tom
    Lead Developer
    Lead Developer

    Static images can’t parallax, only background images can. So you’d have to set up a page header, and have the featured image set as the background image.

    #543583
    Daniel

    ok i understand… but how can i place this image obove the main menu like here

    http://wordpress-55262-461237.cloudwaysapps.com/schulter/

    When i use the head its below the menu…

    thanks for help

    #543951
    Tom
    Lead Developer
    Lead Developer

    Will the image be different on every page, or will it always be the same?

    #544395
    Daniel

    it will be different on every page…

    #544611
    Tom
    Lead Developer
    Lead Developer

    So in this case you can use the Page Header module to build an area with a parallax background image: https://docs.generatepress.com/collection/page-header/

    Then use this PHP to move it above the menu:

    add_action( 'wp', 'tu_move_page_header', 20 );
    function tu_move_page_header() {
        remove_action( 'generate_after_header', 'generate_page_header' );
        add_action( 'generate_before_header', 'generate_page_header' );
    }
    #544659
    Daniel

    perfect

    thanks so much… you’re the best!

    #544778
    Tom
    Lead Developer
    Lead Developer

    No problem πŸ™‚

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