remove fetured mages from single page
-
hi guys, i hope someone can help me out ??
i am using portra theme https://portra.wpshower.com/ for a client, but he wanted several modifications to the theme https://marioland.co/
i solved most of the modifications he wanted, except for one:
this theme has a beautiful horizontal gallery sistem, but the problem is that when you have a post that doesnt include a gallery, the theme automatically generates one using the featured image.
i cant find the way to avoid the featured image inside the posts, and thats what i am tring to do.the only section in all the theme that seems to have something to do with the gallery is this
// single page gallery var gallery = { duration: 300, el: false, images: [], count: 0, first_image: false, init: function() { this.el = $('.gallery-animated'); if (this.el.length == 1) { this.update(); if (this.count != 0) { this.first_image = $(this.images[0]); _window.on('ready load resize', gallery.process); } } }, update: function() { gallery.images = gallery.el.find('img'); gallery.count = gallery.images.length; }, process: function() { var height = gallery.first_image.height(); gallery.images.each(function() { var image = $(this); image.off('click'); if (_window.width() > _tablet_width) { var ratio = image.attr('width') / image.attr('height'); var width = Math.round(height * ratio); image.parent().on('click', function(event) { event.preventDefault(); gallery.move(image); }); image.on('click', function(event) { event.preventDefault(); if ($('#lightbox').length > 0) { $('#content').html('<img src="' + image.attr("src") + '" />'); $('#lightbox').show(); } else { var lightbox = '<div id="lightbox">' + '<p>X</p>' + '<div id="content">' + '<img src="' + image.attr("src") +'" />' + '</div>' + '</div>'; $('body').append(lightbox); } }); $('#lightbox').live('click', function() { $('#lightbox').hide(); }); } }); }, move: function(image) { var scroll = _window.scrollLeft(); var window_width = _window.width(); var offset = gallery.offset(image, window_width); var index = image.parent().index(); if (offset == scroll) { // current image clicked if (index != gallery.count - 1) { // not last image clicked offset = gallery.offset($(gallery.images[index + 1]), window_width); } else { offset = gallery.offset(gallery.first_image, window_width); } } if (offset != scroll) { $('html, body').stop().animate({ scrollLeft: offset }, gallery.duration); } }, offset: function(image, window_width) { var offset = image.offset().left; var width = image.width(); if (width < window_width) { offset -= Math.round((window_width - width) / 2); } return offset; } }; gallery.init();
i dont know what to do with this.
i just want the featured images out of the single posts.
here is an example: in this posts we have some videos, we wanted no gallery, but the theme generated one with the featured image on the right side https://marioland.co/soldados-derretidos/thanxs ??
- The topic ‘remove fetured mages from single page’ is closed to new replies.