{"id":930,"date":"2025-03-24T14:28:03","date_gmt":"2025-03-24T14:28:03","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/fix-for-divi-page-builder-when-the-geodirectory-search-page-has-no-results\/"},"modified":"2025-04-03T15:24:24","modified_gmt":"2025-04-03T14:24:24","slug":"fix-for-divi-page-builder-when-the-geodirectory-search-page-has-no-results","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/builders\/fix-for-divi-page-builder-when-the-geodirectory-search-page-has-no-results\/","title":{"rendered":"Fix for DIVI Page Builder when the GeoDirectory Search page has no results"},"content":{"rendered":"\n<div class=\"wp-block-blockstrap-blockstrap-widget-alert d-flex align-items-center fade show alert alert-info mb-3\" role=\"alert\"><span class=\"fas fa-info-circle me-2\"><\/span><span class=\"flex-grow-1\"><strong>Problem: <\/strong>The <strong>DIVI Page Builder<\/strong> does not check whether a template is active for the <strong>GeoDirectory Search page<\/strong> <strong>When there are no results to be displayed<\/strong> on the GeoDirectory Search page, DIVI does not check if the Search page is built with the DIVI Page Builder. The Search page will look different with results than without results<\/span><\/div>\n\n\n\n<p>To fix this, add the following code to the <strong>functions.php<\/strong> file of your <strong>Divi child theme<\/strong>.<br>(Note that using the Code Snippets plugin for this fix may not work)<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">\/**\n * Fix GeoDirectory + Divi theme search empty results page.\n *\/\nif ( ! function_exists( &#039;et_pb_is_pagebuilder_used&#039; ) ) {\n\tfunction et_pb_is_pagebuilder_used( $page_id = 0 ) {\n\t\tif ( 0 === $page_id ) {\n\t\t\t$page_id = et_core_page_resource_get_the_ID();\n\t\t}\n\n\t\tglobal $wp_query;\n\n\t\tif ( empty( $page_id ) &amp;&amp; ! empty( $wp_query ) &amp;&amp; $wp_query-&gt;is_main_query() &amp;&amp; function_exists( &#039;geodir_is_geodir_page&#039; ) &amp;&amp; geodir_is_geodir_page() ) {\n\t\t\tif ( geodir_is_page( &#039;search&#039; ) ) {\n\t\t\t\t$page_id = geodir_search_page_id();\n\t\t\t} elseif ( geodir_is_page( &#039;archive&#039; ) || geodir_is_page( &#039;post_type&#039; ) ) {\n\t\t\t\t$page_id = geodir_archive_page_id( ( ! empty( $wp_query-&gt;query_vars&#091;&#039;post_type&#039;&#093; ) ? $wp_query-&gt;query_vars&#091;&#039;post_type&#039;&#093; : &#039;&#039; ) );\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t&#039;on&#039; === get_post_meta( $page_id, &#039;_et_pb_use_builder&#039;, true ) ||\n\t\t\t\/\/ Divi layout post type always use the builder\n\t\t\t&#039;et_pb_layout&#039; === get_post_type( $page_id ) ||\n\t\t\t\/\/ Extra Category post type always use the builder\n\t\t\t&#039;layout&#039; === get_post_type( $page_id )\n\t\t);\n\t}\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To fix this, add the following code to the functions.php file of your Divi child theme.(Note that using the Code Snippets plugin for this fix may not work)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[575,737,779,780],"article\/categories":[211,436],"class_list":["post-930","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-search-results","gd_place_tags-divi","gd_place_tags-theme","gd_place_tags-no-results","gd_placecategory-tips-tricks-more","gd_placecategory-builders"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/930","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=930"}],"version-history":[{"count":0,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/930\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=930"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=930"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}