Site logo

Archived topic

Showing featured image before Menu

13 replies · Started by Daniel on April 2, 2018

Viewing posts 1–14 of 14

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

worked :-)

thanks

No problem :)

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

thanks for help

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

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.

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

it will be different on every page...

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' );
}

perfect

thanks so much... you're the best!

No problem :)

This archived topic is closed to new replies.