Monday , February 3 2025

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 iryna

I'm Iryna, a web developer from Ukraine with a decade of experience solving complex technical challenges in the world of freelance. Throughout my career, I've worked on everything from troubleshooting server-side issues and optimizing website performance to enhancing user interfaces. On this blog, I share detailed solutions to the technical problems I’ve encountered and methods that have worked best for me. In addition to my technical expertise, I’m also passionate about digital drawing. I hope the tutorials and insights I provide here will help both fellow developers and creatives alike in their own projects.

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 *