• Hello all. I am new here, so please be kind if I’m posting this in the wrong section. I’ve searched for an answer to this, and have had no luck finding anyone having the same issue.

    When I migrated my site (built on localhost) to my godaddy host, my featured images are not showing up on my main page widget. I’m using the Spacious theme, and the widget TG: Services is the section in question.

    The site I’m working on is http://jmins-solutions.com

    Above the sections Your Family, Your Property, Your Business, there should be a featured image. When I use multiple browsers to check it locally, they show up fine, but the published version does not show images until I have logged in to wp-admin on that computer & browser.

    Any ideas what I’m doing wrong? I’m pretty new to WordPress and coding, but I felt pretty confident my code was right.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey there,

    Sounds like maybe a caching issue. I went to your site and do see a featured image above those Family, Property, Business sections. This is the featured image I see with no issues:

    http://jmins-solutions.com/wp-content/uploads/2015/01/cropped-books-21849_19201.jpg

    Thread Starter paulmannone

    (@paulmannone)

    Sorry, I should have been more clear. That image that you’re seeing is part of a slider. Each of those sections (Family, Property and Business) should have a individual featured image above them. Also, if it helps, they are called through a “get the post thumbnail” line of code.

    Also, I went to a new browser which I had not logged into the WordPress dashboard on, and none of the theme specific widgets are working (the ones that start with TG:, if you are familiar with the theme). It seems like these widgets do not load until I’ve logged in to the dashboard. Unfortunately, I can’t have every visitor login to the dashboard. Hahaha.

    Thanks for your help!

    Do you have any caching plugins or server side caching? If so, disable them or completely purge the cache. Usually caching does NOT affect logged in users but non logged in users would be served cached pages.

    Interesting though because I see this code in the source:

    <div class="service-image"></div> <h1 class="widget-title"><a title="Protecting Your Business" href="http://jmins-solutions.com/?page_id=22">Protecting Your Business</a></h1>

    But I don’t see any links to images.

    Thread Starter paulmannone

    (@paulmannone)

    I don’t believe I have any caching, but I will look into that.
    As for the code you’re seeing, I see that too when I use the developer tools. However, the code that links to the images is in the widgets.php file.

    OK it sounds like for some reason the code doesn’t call the images unless “user is logged in” Not sure why that would be. I am not familiar with the theme, I would probably recommend reaching out directly to the theme developer. Sorry I couldn’t help

    Thread Starter paulmannone

    (@paulmannone)

    This is the code in the widgets.php file:

    echo $before_widget; ?>
    			<?php
    			$j = 1;
     			while( $get_featured_pages->have_posts() ):$get_featured_pages->the_post();
    				$page_title = get_the_title();
    				if( $j % 2 == 1 && $j > 1 ) {
    					$service_class = "tg-one-third tg-after-two-blocks-clearfix";
    				}
    				elseif ( $j % 3 == 1 && $j > 1 ) {
    					$service_class = "tg-one-third tg-after-three-blocks-clearfix";
    				}
    				else {
    					$service_class = "tg-one-third";
    				}
    				if( $j % 2 == 0 ) { $service_class = $service_class.' tg-service-right'; }
    				else { $service_class = $service_class.' tg-service-left'; }
    				?>
    				<div class="<?php echo $service_class; ?>">
    					<?php echo $before_the_post_thumbnail; ?><a href="<?php the_permalink(); ?>">
    					<?php
    					if ( has_post_thumbnail() )  {
    						echo'<div class="service-image">'.get_the_post_thumbnail( $post->ID, 'featured' ).'</div>';
    					}
    					?></a>
    					<?php after_the_post_thumbnail; ?>
    					<?php echo $before_title; ?><a title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>"><?php echo $page_title; ?></a><?php echo $after_title; ?>
    					<?php the_excerpt(); ?>
    					<div class="more-link-wrap">
    						<a class="more-link" title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>"><?php _e( 'Read more','spacious' ); ?></a>
    					</div>
    				</div>
    				<?php $j++; ?>
    			<?php endwhile;
    	 		// Reset Post Data
     			wp_reset_query();
     			?>
    		<?php
    		echo $after_widget;

    Thread Starter paulmannone

    (@paulmannone)

    Thanks for trying! I’ll keep working on it.

    OK good luck! It is indeed strange!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Featured Images not showing in widget until login’ is closed to new replies.