<div class="home-header-wrap"> <?php echo '<div class="header-content-wrap">'; echo '<section id="homepage">'; echo '<div class="container">'; //Render gallery if at least 2 slides available $slides = get_registered_gallery_slides(); $captions = get_registered_slide_captions(); $openlab_bigtitle_title = get_theme_mod('openlab_bigtitle_title', __('OpenLab is a space of open Source Software', 'openlab-txtd')); if ($slides !== false && count($slides) >= 1) { echo '<div class="gallery-wrapper">'; echo '<div class="gallery js-flickity" data-flickity-options=\'{ "imagesLoaded": true, "percentPosition": true, "setGallerySize": false, "contain": true}\'>'; foreach ($slides as $key => $slide) { echo '<div class="slider-image" style="background-image: url(' . $slide . ');">'; if (isset($captions[$key]) && $captions[$key] !== '') { echo '<div class="slide-caption-wrap"><span class="inner-caption">' . trim(strip_tags($captions[$key])) . '</span></div>'; } echo '</div>'; } echo '</div>'; echo '</div>'; } echo '</div>'; echo '</div><!-- section -->'; echo '</div><!-- .header-content-wrap -->'; echo '<div class="clear"></div>'; ?> </div>
function remove_class_function($classes) { if (!is_home()) { // index of custom-background $key = array_search('custom-background', $classes); // remove class unset($classes[$key]); } else { $avail_sl = get_registered_gallery_slides(); if ($avail_sl !== false || count($avail_sl) >= 1) { //add extra class to body $classes[] = 'no-background'; $key = array_search('custom-background', $classes); // remove class unset($classes[$key]); } } return $classes; }