Skip to content

Commit

Permalink
* GD search broken on some block theme - FIXED
Browse files Browse the repository at this point in the history
* Astra theme GD search broken - FIXED
  • Loading branch information
Stiofan committed Jul 18, 2024
1 parent 58cf71b commit d5266ab
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
19 changes: 18 additions & 1 deletion includes/class-geodir-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public static function init() {

// Astra Theme v4.1 compatibility
add_filter( 'astra_single_layout_one_banner_visibility', array( __CLASS__, 'astra_single_layout_one_banner_visibility' ), 9999, 1 );
add_filter( 'astra_primary_class', array( __CLASS__, 'astra_primary_class' ), 100, 2 );
add_filter( 'astra_entry_header_class', array( __CLASS__, 'astra_entry_header_class' ), 10, 1 );
add_filter( 'astra_get_option_ast-dynamic-archive-page-structure', array( __CLASS__, 'astra_filter_option' ), 10, 3 );

Expand Down Expand Up @@ -1463,7 +1464,7 @@ public static function astra_single_layout_one_banner_visibility( $value ) {
$gd_skip_the_content = true;

if ( geodir_is_page( 'search' ) ) {
$value = false;
//$value = false;
}
}

Expand All @@ -1488,6 +1489,22 @@ public static function astra_entry_header_class( $classes ) {
return $classes;
}

/**
* Fix the page classes for GD archives.
*
* @param $classes
* @param $class
* @return mixed|string[]
*/
public static function astra_primary_class($classes, $class)
{
if(geodir_is_page('search') || geodir_is_page('archive')){
return ['content-area','primary'];
}
return $classes;

}

/**
* Filter Astra option.
*
Expand Down
3 changes: 2 additions & 1 deletion includes/widgets/class-geodir-widget-loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
rewind_posts();

// Reset the proper loop content
if ( isset( $wp_query->posts[0] ) && $wp_query->posts[0]->post_type == 'page' && geodir_is_page('search') ) {
if ( isset( $wp_query->posts[0] ) && $wp_query->posts[0]->post_type == 'page' && geodir_is_page('search') && !geodir_is_block_theme()) {
$wp_query->current_post = $wp_query->post_count;
return ob_get_clean();
}

Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ We don't offer free trials, but we have a 30-day money-back guarantee if you are

__WARNING: GDv2 is a significant update over GDv1 and may require manual work, such as adding widgets to sidebars to recreate your current layout. As always, we recommend trying this on a staging site first. [Learn more](https://docs.wpgeodirectory.com/article/260-upgrading-from-gdv1-to-gdv2)__

= GeoDirectory v2.3.67 - 2024-07-18 =
* GD search broken on some block theme - FIXED
* Astra theme GD search broken - FIXED

= GeoDirectory v2.3.66 - 2024-07-17 =
* non FSE themes can fail to render new blocks - FIXED
* Image attribute in schema shows location when private address is enabled - FIXED
Expand Down

0 comments on commit d5266ab

Please sign in to comment.