• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Betheme | Responsive Multipurpose WordPress & WooCommerce Theme

Betheme | Responsive Multipurpose WordPress & WooCommerce Theme v27.3.8

No permission to download
I just want to share my image gallery slider mod.
Yes, this theme has a slider but you have to add each slide separately. Yes, this theme has a image gallery but it doesn't have slider effect. It's very easy when you add images as image gallery.

I changed gallery shortcode masonry style to slider effect. If you select masonry, your images shown as slider.

It's for version 21.3.7 and i'm using it.

EASY METHOD
Add these codes to functions.php in child theme. Because we don't want to break parent theme. Then activate child theme.

PHP:
/*
Gallery Mod - Start --->
*/

if (! function_exists('sc_gallery')) {
    function sc_gallery($attr)
    {
        $post = get_post();

        static $instance = 0;
        $instance++;

        if (! empty($attr['ids'])) {
            // 'ids' is explicitly ordered, unless you specify otherwise.
            if (empty($attr['orderby'])) {
                $attr['orderby'] = 'post__in';
            }
            $attr['include'] = $attr['ids'];
        }

        // We're trusting author input, so let's at least make sure it looks like a valid orderby statement
        if (isset($attr['orderby'])) {
            $attr['orderby'] = sanitize_sql_orderby($attr['orderby']);
            if (! $attr['orderby']) {
                unset($attr['orderby']);
            }
        }

        $html5 = current_theme_supports('html5', 'gallery');
        $atts = shortcode_atts(array(
            'order'                => 'ASC',
            'orderby'        => 'menu_order ID',
            'id'             => $post  ? $post->ID : 0,
            'itemtag'        => $html5 ? 'figure'     : 'dl',
            'icontag'        => $html5 ? 'div'        : 'dt',
            'captiontag'     => $html5 ? 'figcaption' : 'dd',
            'columns'        => 3,
            'size'           => 'thumbnail',
            'include'        => '',
            'exclude'        => '',
            'link'           => '',
        
      'slidesToShow' => '3',
            'slidesToScroll' => '1',
            'autoplaySpeed' => '3000',

        // mfn custom ---------------------------
            'style'            => '',    // [default], flat, fancy, masonry, slider!
            'greyscale'        => '',

        ), $attr, 'gallery');


        // Muffin | Custom Classes -----------------
    
        if ($atts['style'] == 'masonry') {
      $atts['style'] == 'slider';
      $atts['itemtag'] = 'div';
      $atts['icontag'] = 'div';
      $atts['slidesToShow'] = $atts['columns'];
      $atts['columns'] = 1;
        }
    
    
        $class = $atts['link'];
        if ($atts['style']) {
            $class .= ' '. $atts['style'];
        }
        if ($atts['greyscale']) {
            $class .= ' greyscale';
        }


        $id = intval($atts['id'], 10);
        if ('RAND' == $atts['order']) {
            $atts['orderby'] = 'none';
        }

        if (! empty($atts['include'])) {
            $_attachments = get_posts(array( 'include' => $atts['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ));

            $attachments = array();
            foreach ($_attachments as $key => $val) {
                $attachments[$val->ID] = $_attachments[$key];
            }
        } elseif (! empty($atts['exclude'])) {
            $attachments = get_children(array( 'post_parent' => $id, 'exclude' => $atts['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ));
        } else {
            $attachments = get_children(array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ));
        }

        if (empty($attachments)) {
            return '';
        }

        if (is_feed()) {
            $output = "\n";
            foreach ($attachments as $att_id => $attachment) {
                $output .= wp_get_attachment_link($att_id, $atts['size'], true) . "\n";
            }
            return $output;
        }

        $itemtag = tag_escape($atts['itemtag']);
        $captiontag = tag_escape($atts['captiontag']);
        $icontag = tag_escape($atts['icontag']);
        $valid_tags = wp_kses_allowed_html('post');
        if (! isset($valid_tags[ $itemtag ])) {
            $itemtag = 'dl';
        }
        if (! isset($valid_tags[ $captiontag ])) {
            $captiontag = 'dd';
        }
        if (! isset($valid_tags[ $icontag ])) {
            $icontag = 'dt';
        }

        $columns = intval($atts['columns'], 10);

        $itemwidth = $columns > 0 ? (ceil(100/$columns*100)/100 - 0.01) : 100;

        $float = is_rtl() ? 'right' : 'left';

        $selector = "sc_gallery-{$instance}";

        $gallery_style = '';

        if (apply_filters('use_default_gallery_style', ! $html5)) {
            $gallery_style = "
            <style type='text/css'>
                #{$selector} {
                    margin: auto;
                }
                #{$selector} .gallery-item {
                    float: {$float};
                    margin-top: 10px;
                    text-align: center;
                    width: {$itemwidth}%;
                }
                #{$selector} img {
                    border: 2px solid #cfcfcf;
                }
                #{$selector} .gallery-caption {
                    margin-left: 0;
                }
                /* see sc_gallery() in functions/theme-shortcodes.php */
            </style>\n\t\t";
        }

        $size_class = sanitize_html_class($atts['size']);
        $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class} {$class}'>";

        $output = apply_filters('gallery_style', $gallery_style . $gallery_div);

        $i = 0;
        foreach ($attachments as $id => $attachment) {
            if (! empty($atts['link']) && 'file' === $atts['link']) {
                $image_output = wp_get_attachment_link($id, $atts['size'], false, false);
            } elseif (! empty($atts['link']) && 'none' === $atts['link']) {
                $image_output = wp_get_attachment_image($id, $atts['size'], false);
            } else {
                $image_output = wp_get_attachment_link($id, $atts['size'], true, false);
            }
            $image_meta  = wp_get_attachment_metadata($id);

            $orientation = '';
            if (isset($image_meta['height'], $image_meta['width'])) {
                $orientation = ($image_meta['height'] > $image_meta['width']) ? 'portrait' : 'landscape';
            }
            $output .= "<{$itemtag} class='gallery-item'>";
            $output .= "
                <{$icontag} class='gallery-icon {$orientation}'>
                    $image_output
                </{$icontag}>";
            if ($captiontag && trim($attachment->post_excerpt)) {
                $output .= "
                    <{$captiontag} class='wp-caption-text gallery-caption'>
                    " . wptexturize($attachment->post_excerpt) . "
                    </{$captiontag}>";
            }
            $output .= "</{$itemtag}>";
            if ($atts['style'] !== 'slider' && ! $html5 && $columns > 0 && ++$i % $columns == 0) {
                $output .= '<br style="clear: both" />';
            }
        }

        if ($atts['style'] !== 'slider' && ! $html5 && $columns > 0 && $i % $columns !== 0) {
            $output .= "
                <br style='clear: both' />";
        }

        $output .= "
            </div>\n";
        if ($atts['style'] == 'slider') {
     $output .= "<script type=\"text/javascript\">
      jQuery(document).ready(function(){
        var slider = jQuery(\"#{$selector}\");
        slider.slick({
          slidesToShow:{$atts['slidesToShow']},
          slidesToScroll:{$atts['slidesToScroll']},
          autoplay: true,
          autoplaySpeed:{$atts['autoplaySpeed']},
          arrows: false
        });
    


       // Lightbox | disable on dragstart | childdan geliyoruz

      var clickEvent = false;

      slider.on('dragstart', '.slick-slide a[rel^=\"lightbox\"]', function(event) {

          var events = jQuery(this).data('events');
          clickEvent = events.click[0];
          jQuery(this).addClass('off-click').off('click');

      });

      // Lightbox | enable after change

      slider.on('afterChange', function(event, slick, currentSlide, nextSlide) {

          jQuery('a.off-click[rel^=\"lightbox\"]', slider).removeClass('off-click').on('click', clickEvent);

      });

  
      });
      </script>";
    }

        return $output;
    }
}
/*
<--- Gallery Mod - End
*/
---
ADVANCED METHOD
Caution: If you don't have experience with php, please do not do this. You have been warned.

You can implement this mod directly to parent theme. With this method, you will add slider option to image gallery object. So you can use masonry and slider separately.
.
Change gallery shortcode in /functions/theme-shortcodes.php with above codes, and;
find this line:
if ($atts['style'] == 'masonry') {

change to this
if ($atts['style'] == 'slider') {


open /functions/builder/class-mfn-builder-fields.php
find this line 3787:
Code:
                           'options'     => array(
                               ''             => __('Default', 'mfn-opts'),
                               'flat'         => __('Flat', 'mfn-opts'),
                               'fancy'     => __('Fancy', 'mfn-opts'),
                               'masonry'     => __('Masonry', 'mfn-opts'),
                           ),

change to this
Code:
                           'options'     => array(
                               ''             => __('Default', 'mfn-opts'),
                               'flat'         => __('Flat', 'mfn-opts'),
                               'fancy'     => __('Fancy', 'mfn-opts'),
                               'masonry'     => __('Masonry', 'mfn-opts'),
                               'slider'     => 'Slider',
                           ),

Example:
k3148799jr73.gif
 
Last edited:
I just want to share my image gallery slider mod.
Yes, this theme has a slider but you have to add each slide separately. Yes, this theme has a image gallery but it doesn't have slider effect. It's very easy when you add images as image gallery.

I changed gallery shortcode masonry style to slider effect. If you select masonry, your images shown as slider.

It's for version 21.3.7 and i'm using it.

It would be more awesome if you could provide output/resultant screenshot of it as well :)
 
Hi,
Concerning this theme, do you know how to remove, the BUY NOW action button on the menu?
Any suggestion it would be really great.

many thanks in advance
 
There is no opportunity in the Menu section, I tried everything, even checking the codes, but it's really hard to figure it out.
 

Attachments

  • Screenshot 2019-09-22 19.14.30.png
    Screenshot 2019-09-22 19.14.30.png
    183 KB · Views: 14
Babak updated BeTheme - Responsive Multi-Purpose WordPress Theme with a new update entry:

BeTheme v21.3.8

Download BeTheme v21.3.8 - Responsive Multi-Purpose WordPress Theme Nulled Free
Version 21.3.8 – September 23, 2019

  • Added: New Google Fonts - 959 fonts available
  • Fixed: Buttons - Style: Round - Back to top: Sticky - Position
  • Fixed: Shop - Product shortcode - Pagination
  • Pre-built website: SEO 3, Lawyer 5

  • changelog.html
  • functions.php
  • style.css
  • css/layout.css
  • functions/importer/css/style.css
  • functions/importer/images/demos.jpg...

Read the rest of this update entry...
 
Babak updated BeTheme - Responsive Multi-Purpose WordPress Theme with a new update entry:

BeTheme v21.3.8 Nulled

Download BeTheme v21.3.8 Nulled - Responsive Multi-Purpose WordPress Theme Free
Version 21.3.8 – September 23, 2019

  • Added: New Google Fonts - 959 fonts available
  • Fixed: Buttons - Style: Round - Back to top: Sticky - Position
  • Fixed: Shop - Product shortcode - Pagination
  • Pre-built website: SEO 3, Lawyer 5

  • changelog.html
  • functions.php
  • style.css
  • css/layout.css
  • functions/importer/css/style.css
  • functions/importer/images/demos.jpg...

Read the rest of this update entry...
 

Forum statistics

Threads
78,620
Messages
1,122,712
Members
245,502
Latest member
lalu_papa
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock