Use slider as background to home page
-
Hi,
I have started to put a website together and have purchased the slider plugin and really want to get it working as a background slider and not just use a static image as you’ll see in the link above.
So I created my own header for the home page and all the code is below:
<?php /** * Display Header Media * * @package PhotoFocus */ if ( 'disable' === get_theme_mod( 'photofocus_header_media_option', 'entire-site' ) ) { return; } $backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' ); get_header(); $header_image = photofocus_featured_overall_image(); $header_media_text = photofocus_has_header_media_text(); if ( ( ( is_header_video_active() && has_header_video() ) || 'disable' !== $header_image ) || $header_media_text ) : ?> <div id="overlay" onclick="off()"> <div id="overlayImage" style="display: block;"> <img src="https://www.accend4web.co.uk/Noma/wp-content/uploads/2022/04/logo.png" /> <br/> <p class="homeCover" style="color:#1f5a8a; text-align:center; font-size: 2em;"><span>care | commercial | education | health | residental</span></p> </div> </div> <div class="custom-header header-media" style="background: url('<?php echo $backgroundImg[0]; ?>') no-repeat; background-size: cover; background-position: center;"> <div class="wrapper"> <div class="custom-header-media"> <?php photofocus_header_media_text(); ?> <div id="homeFooterInfoWrapper"> <div id="homeFooterInfoLeft">TEL | 0117 929 2041</div> <div id="homeFooterInfoRight"><a href="mailto:[email protected]">[email protected]</a></div> </div> </div> </div><!-- .wrapper --> <div class="custom-header-overlay"></div><!-- .custom-header-overlay --> </div><!-- .custom-header --> <?php endif; ?> <div id="breadcrumbWrapper"> <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); } ?> </div>
What Id love to do is create a couple of slides in Smart Slider and somehow use that instead of the way I have done it where the user can edit the image via the Featured Image option.
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Use slider as background to home page’ is closed to new replies.