{"id":2690,"date":"2026-10-20T08:35:27","date_gmt":"2026-10-20T07:35:27","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/images-not-loading-in-tabs-until-scroll\/"},"modified":"2026-10-20T08:41:00","modified_gmt":"2026-10-20T07:41:00","slug":"images-not-loading-in-tabs-until-scroll","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/troubleshooting\/images-not-loading-in-tabs-until-scroll\/","title":{"rendered":"GeoDirectory images not loading in tabs until you scroll"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">GeoDirectory lazy loads listing images: each image loads when it comes into view. The GD &gt; Post Images block does this when its &#8220;Load via Ajax&#8221; setting is on, which it is in the default archive item template. The check skips hidden images. When listings sit in a tab, accordion or slider that is closed when the page loads, their images wait until the page next scrolls or resizes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are two ways to fix it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run the image check when a tab opens<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">GeoDirectory looks for images to load whenever the window receives a <code>lookup<\/code> event, and it fires that event for its own tabs. For tabs from your theme or page builder, fire the same event when a tab is clicked. Add this with the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/useful-plugins\/code-snippets-plugin\/\">Code Snippets plugin<\/a> or your child theme&#8217;s functions.php:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">add_action( &#039;wp_footer&#039;, &#039;my_gd_lazy_load_in_tabs&#039;, 100 );\nfunction my_gd_lazy_load_in_tabs() {\n\t?&gt;\n\t&lt;script&gt;\n\tjQuery(function($) {\n\t\t\/\/ Change the selector to match the tab buttons on your page.\n\t\t$(document).on(&#039;click&#039;, &#039;.et_pb_tabs_controls li, &#091;data-toggle=&quot;tab&quot;&#093;, &#091;data-bs-toggle=&quot;tab&quot;&#093;&#039;, function() {\n\t\t\tsetTimeout(function() {\n\t\t\t\t$(window).trigger(&#039;lookup&#039;);\n\t\t\t}, 150);\n\t\t});\n\t});\n\t&lt;\/script&gt;\n\t&lt;?php\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The selector covers Divi&#8217;s Tabs module and standard Bootstrap tabs. For other builders, replace it with the class of the tab buttons on your page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Turn off lazy loading for those images<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the template that prints the images, usually the Archive item page set at GeoDirectory &gt; Settings &gt; General &gt; Pages. Select the GD &gt; Post Images block and untick &#8220;Load via Ajax&#8221; in its advanced settings. The images then load with the page. That is slower on long lists, but they never wait for a scroll.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Maps have their own lazy load setting at GeoDirectory &gt; Settings &gt; General, under Map Settings. To change the placeholder shown before an image loads, see <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/code-snippets\/change-lazyload-placeholder-image\/\">Change Lazyload Placeholder Image<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GeoDirectory lazy loads listing images: each image loads when it comes into view. The GD &gt; Post Images block does this when its &#8220;Load via Ajax&#8221; setting is on, which it is in the default archive item template. The check skips hidden images. When listings sit in a tab, accordion or slider that is closed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,437],"class_list":["post-2690","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-troubleshooting"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=2690"}],"version-history":[{"count":1,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2690\/revisions"}],"predecessor-version":[{"id":2832,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2690\/revisions\/2832"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2690"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2690"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}