diff --git a/woocommerce-template.php b/woocommerce-template.php index 7e7795c98ce..7135c7af823 100644 --- a/woocommerce-template.php +++ b/woocommerce-template.php @@ -26,19 +26,19 @@ if (!function_exists('woocommerce_content')) { if (!function_exists('woocommerce_archive_product_content')) { function woocommerce_archive_product_content() { - if (!is_search()) : + if (!is_search()) { $shop_page = get_post( woocommerce_get_page_id('shop') ); $shop_page_title = apply_filters('the_title', (get_option('woocommerce_shop_page_title')) ? get_option('woocommerce_shop_page_title') : $shop_page->post_title); - $shop_page_content = $shop_page->post_content; - else : + if( is_object( $shop_page ) ) $shop_page_content = $shop_page->post_content; + } else { $shop_page_title = __('Search Results:', 'woocommerce') . ' “' . get_search_query() . '”'; if (get_query_var('paged')) $shop_page_title .= ' — ' . __('Page', 'woocommerce') . ' ' . get_query_var('paged'); $shop_page_content = ''; - endif; + } ?>
- + @@ -764,4 +764,4 @@ if (!function_exists('woocommerce_form_field')) { if ($args['return']) return $field; else echo $field; } -} \ No newline at end of file +}