{"id":951,"date":"2025-03-24T14:28:07","date_gmt":"2025-03-24T14:28:07","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/change-lazyload-placeholder-image\/"},"modified":"2025-04-03T15:24:27","modified_gmt":"2025-04-03T14:24:27","slug":"change-lazyload-placeholder-image","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/code-snippets\/change-lazyload-placeholder-image\/","title":{"rendered":"Change Lazyload Placeholder Image"},"content":{"rendered":"\n<p>The below code snippet will change the placeholder image used when maps are set to lazy load.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">add_filter(&#039;geodir_map_params&#039;,&#039;_my_lazylod_placeholder_image&#039;);\nfunction _my_lazylod_placeholder_image($args){\n\tif(!empty($args&#091;&#039;lazyLoadPlaceholder&#039;&#093;)){\n\t\t$args&#091;&#039;lazyLoadPlaceholder&#039;&#093; = &quot;https:\/\/localhost.com\/my-image.svg&quot;;\n\t}\n\treturn $args;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The below code snippet will change the placeholder image used when maps are set to lazy load.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[813],"article\/categories":[211,432,433],"class_list":["post-951","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-lazyload","gd_placecategory-tips-tricks-more","gd_placecategory-how-tos","gd_placecategory-code-snippets"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/951","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=951"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/951\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=951"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=951"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}