Back to Community

Troubleshooting Slider Integration in the Twenty Seventeen Theme Header

7 threads Sep 9, 2025 ThemeTwenty seventeen

Content

Integrating a third-party slider plugin like MetaSlider, Smart Slider 3, or Slider Revolution into the Twenty Seventeen theme's header is a common request. However, users often encounter issues such as the slider not appearing in the correct location, breaking on mobile, or conflicting with the theme's built-in styles. This guide outlines the most frequent problems and their solutions, based on community reports.

Common Problems and Solutions

1. Slider Appears in the Wrong Location (e.g., Below the Header)

Why it happens: The Twenty Seventeen theme has a specific structure for its header area. Simply adding a slider shortcode to the header.php file often places it outside the necessary container divs, causing it to appear below the intended header space.

Solution: The most targeted approach is to modify the correct template part file. Instead of header.php, you should add your slider shortcode to the theme's template-parts/header/header-image.php file. This file controls the display of the header media on the front page. Replacing the existing code or strategically placing your shortcode within this file is more likely to position the slider correctly within the header.

2. Slider is Not Responsive on Mobile Devices

Why it happens: This is typically a configuration issue within the slider plugin itself, not a direct conflict with the Twenty Seventeen theme. The plugin may not be generating responsive output, or the specific slider settings might be using fixed dimensions.

Solution:

  • First, check your slider plugin's settings. Ensure the slider is set to a responsive mode (e.g., 100% width) rather than a fixed pixel width.
  • Consult the documentation for your specific slider plugin (e.g., MetaSlider, Slider Revolution) for guidance on enabling mobile responsiveness.
  • Test the slider directly within a page or post first to confirm it is responsive on its own before troubleshooting the theme integration.

3. Interactive Elements (Buttons, Links) in the Slider Do Not Work

Why it happens: The Twenty Seventeen theme includes a built-in header video script that can sometimes interfere with the scripts and interactive elements of third-party sliders, effectively "overriding" them as mentioned in one support thread.

Solution: A common fix is to conditionally remove the theme's header video script when your slider is active. This can often be done by adding the following code to your child theme's functions.php file:

function remove_header_video_script() {
    if ( is_front_page() ) { // Only on the front page if that's where the slider is
        wp_dequeue_script( 'twentyseventeen-header' );
    }
}
add_action( 'wp_enqueue_scripts', 'remove_header_video_script', 100 );

Warning: Always use a child theme when modifying theme files or functions to prevent your changes from being overwritten during theme updates.

4. Slider Appears on All Pages Instead of Just the Front Page

Why it happens: The header-image.php template part is often used for the header media across the entire site. If you replace its content with a slider shortcode without any conditional logic, the slider will display on every page.

Solution: Wrap your slider shortcode in a conditional PHP statement to check if the current page is the front page. Modify the code in header-image.php to look something like this:

if ( is_front_page() ) {
    echo do_shortcode('[metaslider id="123"]');
} else {
    // The original header code can go here if you still want it on other pages
}

5. Slider No Longer Behind Site Title and Logo on Navigation

Why it happens: This is related to the specific CSS structure of the Twenty Seventeen header. When you navigate away from the front page, the theme may apply different CSS classes that affect the stacking order (z-index) of the header elements.

Solution: This usually requires adding custom CSS to your theme. In the WordPress Customizer under Additional CSS, try adding rules to ensure the slider container has a lower z-index than the site branding. For example:

.custom-header-media {
    z-index: 1;
}
.site-branding {
    z-index: 2;
    position: relative;
}

General Best Practices

  • Use a Child Theme: Never modify the core Twenty Seventeen theme files directly. Any changes should be made in a child theme to ensure they are safe during updates.
  • Clear Caches: After making changes to your theme's PHP files or CSS, always clear any caching plugins or server-side caches you have running to see the changes immediately.
  • Check Plugin Conflicts: If a solution stops working suddenly, deactivate all other plugins temporarily to see if a new plugin is causing a conflict.

If these solutions do not resolve your issue, it is recommended to seek help in the specific support forums for your slider plugin, as the issue may be related to its unique implementation.