• I was just wondering if anyone here has seen a plugin or found a way through coding to set up rotating header images in Twenty Seventeen. Even better would be a way to have rotating videos. In either case it would be very cool if site visitors could see a new image/video in the header every day or maybe on each visit.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Randomized headers are built into WordPress. First, upload a few header images in the Customizer’s Header Image section. Then click the “Randomize uploaded headers” button below them. That should display new one on each page load.

    Nice to know with the randomized header feature, but this is on every page load.
    My customer would like to have 4 pictures in a classical slider style.
    Kathryn, may you have a code snippet for that?

    I am thinking about making a video out of the 4 images, but 4 images each shown for 5 seconds could lead into a large mp4-file to load. I dont like that solution.

    May I could put a slider plugin in the header section of the homepage while disabling the header. I guess I can not manage it, because of lack of knowledge.

    Every hint for placing a slider into the header of the homepage would be great.

    • This reply was modified 7 years, 9 months ago by -avocado-.
    Thread Starter videosc

    (@videosc)

    Oops… I didn’t see that randomize image option in the customizer so thanks for pointing that out Kathryn.

    I guess my original question should be modified to ask if anyone knows of a way to randomize video clips.

    Just a thought — What about animated gif files? That would not be as large as a video, but would give you a video-like presentation. I have not tried it, but let me know if it works. Or would Kathryn have another idea?

    Thread Starter videosc

    (@videosc)

    The last time I checked (like several years ago) I do not believe the WordPress media uploader allowed gif files. Maybe I’m wrong or this has been changed.

    Moderator Kathryn Presner

    (@zoonini)

    Animated GIFs is a great idea, @stilman-davis.

    @videosc – I just tested to be sure — you can upload an animated GIF as a custom header, no problem. Here’s a screencast: https://cloudup.com/czs1kz_dlbH

    This would probably be the easiest way to get randomized video-like headers.

    I could manage to get a slider running (instead of using the header images/video feature) – just for the frontpage:

    Open header-image.php under template-parts/header and change
    from:
    <?php the_custom_header_markup(); ?>

    to:

    <?php if ( twentyseventeen_is_frontpage()) { 
       echo do_shortcode("[slider id='1']"); 
       } 
       else the_custom_header_markup(); ?>

    Make sure using a child theme.

    Hi @-avocado-,

    I used your code snippet and it is indeed working. However, it seems the slider is only loaded upon a “hard refresh” (CTRL+F5). Any subsequent load (F5 refresh of the page, or link to the homepage) does not display the slider.

    Did anyone else run into this? Or does anyone have an idea where I should be looking for a solution (the plugin seems to work fine, but the refresh of a page does not seem to kick off the slider)?

    Any input is welcome ??

    Thanks in advance.

    Regards,

    Remco

    • This reply was modified 7 years, 6 months ago by rgerrets.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Rotating Header Images & Video Options?’ is closed to new replies.