Friday , December 20 2024

Popup images not working in WordPress Total theme

Description of the problem – pictures pop up using all kinds of carousels from Total theme, but when customizing the output of a pop-up thumbnail for a blog (see example below), these pictures did not pop up with class=”wpex-lightbox”.

The problem is that Total theme scripts are not displayed on all pages, but only where necessary. If you need the theme functionality to work everywhere, you need to add lightbox loading everywhere in functions.php:

add_filter( 'wpex_load_ilightbox_globally', '__return_true' );

Here is a ready-made solution for a pop-up blog thumbnail:

if ( 'thumbnail' == $media_type ) {
	$thumb_id = get_post_thumbnail_id();
	$thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true);
echo '<a href="';
echo $thumb_url[0];
echo '" class="wpex-lightbox">';
	the_post_thumbnail();
echo '</a>';
	//get_template_part( 'partials/blog/media/blog-single' ); // fallback support for pre v5

		}

About admin

Hi there! My name is Iryna, I am a web developer from Ukraine. While working on freelance projects I often face different technical issues and in this blog I publish articles on how to solve them. I am also interested in digital drawing and in this blog you will find brief tutorials that helped me and hopefully can help you as well.

Check Also

How to remove 404 //fonts.gstatic.com and //fonts.googleapis.com from WordPress head section

I tried solutions with functions that should remove from head and , but a very …

Leave a Reply

Your email address will not be published. Required fields are marked *