Betheme | Responsive Multipurpose WordPress & WooCommerce Theme

Betheme | Responsive Multipurpose WordPress & WooCommerce Theme v28.0.6

No permission to download

askerasker

New member
Nov 27, 2018
6
8
3
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:

CyberDeviL

Back to Life 🧬
Trusted Uploader
Aug 10, 2018
2,795
10,824
113
Earth
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 :)
 

leonardod

New member
Sep 22, 2019
2
0
1
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
 

leonardod

New member
Sep 22, 2019
2
0
1
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

tanierlyons

Well-known member
Staff member
Administrative
Moderator
May 24, 2018
75,188
111,759
120
Tomz 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...
 

tanierlyons

Well-known member
Staff member
Administrative
Moderator
May 24, 2018
75,188
111,759
120
Tomz 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...
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu