Chromium Adblock blocks thumbnails pulled from the_post_thumbnail function
-
Hi,
I’m developing a portfolio site for a client and am building a dynamically updated homepage gallery to highlight six recent projects. I’m using the_post_thumbnail to pull images and a query_posts call to pull the posts.
When the user clicks on a thumbnail the post is displayed into a jquery lightbox pop-up.
Adblock in Chrome is interfering with the display of the thumbnail images in the gallery. While the 1st thumbnail image and “default thumb” for posts without any set thumbnail loads, the subsequent thumbnails called from the_post_thumbnail function do not appear.
I’m a bit flummoxed at this stage, having spent a considerable amount of time searching for a fix. I don’t think it’s an issue about the filterlists as this post describes: https://tinyurl.com/aj3mt5
But, my guess is that it has to do with the way the thumbnails are being called by the function itself? The site is currently in development locally, but I’ve copied the pertinent code below. Any help or advice would be greatly appreciated.
Besides having to detect and then display a message telling someone to turn-off their adblocking software, I’m wondering if anyone else has encountered this problem and found a solution?
<div id="projectBrowser"> <?php $featured = array( 'posts_per_page' => 6, 'post__in' => get_option('sticky_posts') ); query_posts($featured); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); {?> <a href="<?php the_permalink(); ?>?iframe=true&width=100%&height=100%" class="" rel="prettyPhoto[iframe]" > <div class="project caption"> <?php if ( has_post_thumbnail() )//Insert featured thumbnail for project or default if not specified the_post_thumbnail( 'project-thumbnail' ); else echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/default_thumb.jpg" alt="" title="" />'; ?> <div class="cover projectcaption"> <h3><?php the_title(); ?></h3> <?php the_excerpt(); ?> </div> <span class="projectCategory"> <p><?php // Retrieve name of category of each featured project $category = get_the_category(); echo $category[0]->cat_name; ?> </p> </span> </div><!--project caption--> </a> <?php } ?> <?php endwhile; endif; ?> </div><!--#projectBrowser -->
- The topic ‘Chromium Adblock blocks thumbnails pulled from the_post_thumbnail function’ is closed to new replies.