• How can I add a slider in the header of the header.php? What do I have to replace there? I use a slider plugin, CPT Bootstrap Carousel, which gives me a shortcode [image-carousel] for the page. Because I can probably not insert it into the header.php. Then there is a line “echo do_shortcode (‘[image-carousel]” provided by the plugin. In header.php I see the area that provides the banner image in the header, but I don’t know how I can replace that with a carousel slider.

Viewing 1 replies (of 1 total)
  • Theme Author Afterimage Designs

    (@afterimagedesigns)

    Hi @michael1999,

    In order for this to work, please make sure that your theme is using a child theme to prevent change loss on theme updates. Follow these steps to add the slider on banner:

    1. First is disabled the header banner https://prnt.sc/whwrup
    2. Copy the header.php that comes from the parent theme into the child theme.
    3. Under this block of code https://prnt.sc/whwtph. Add this code <?php echo do_shortcode('[image-carousel]'); ?>
    4. Click the Update file.

    In order to limit the slider in some page or only in home page, you could check this conditional tags from WordPress https://developer.ww.wp.xz.cn/themes/basics/conditional-tags/. By using if statement you could limit the slider in specific pages.

    Regards,
    Afterimage Designs

Viewing 1 replies (of 1 total)

The topic ‘Replace header image with a slider’ is closed to new replies.