Function Reference: is_page_geodir_home
Summary
Checks whether the current page is geodirectory home page or not.
Global Values
- $wpdb
- (object) (required) WordPress Database object.
- Default: None
Package
GeoDirectory
Return Values
- (bool)
- If current page is GD home page returns true, else false.
Change Log
Since: 1.0.0
Source File
is_page_geodir_home() is located in geodirectory-functions/general_functions.php [Line: 2780]
Source Code
function is_page_geodir_home() { global $wpdb; $cur_url = str_replace( array( "https://", "http://", "www." ), array( '', '', '' ), geodir_curPageURL() ); if ( function_exists( 'geodir_location_geo_home_link' ) ) { remove_filter( 'home_url', 'geodir_location_geo_home_link', 100000 ); } $home_url = home_url( '', 'http' ); if ( function_exists( 'geodir_location_geo_home_link' ) ) { add_filter( 'home_url', 'geodir_location_geo_home_link', 100000, 2 ); } $home_url = str_replace( "www.", "", $home_url ); if ( ( strpos( $home_url, $cur_url ) !== false || strpos( $home_url . '/', $cur_url ) !== false ) && ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) ) { return true; } elseif ( get_query_var( 'page_id' ) == get_option( 'page_on_front' ) && 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) { return true; } else { return false; } }