Hello There,
Try following PHP snippet to apply MagPlus layout settings to GeoDirectory pages.
if(!function_exists('magplus_get_opt')) {
function magplus_get_opt($option) {
global $magplus_theme_options;
$local = false;
//get local from main shop page
if (class_exists( 'WooCommerce' ) && (is_shop() || is_product_category() || is_product_tag())) {
$shop_page = wc_get_page_id( 'shop' );
if (!empty($shop_page)) {
$value = magplus_get_post_opt( $option.'-local', (int)$shop_page);
$local = true;
}
// Get local from metaboxes for GeoDirectory pages.
} else if ( function_exists( 'geodir_is_geodir_page' ) && geodir_is_geodir_page() && ( $page_id = (int) GeoDir_Compatibility::gd_page_id() ) ) {
if ( in_array( $option, array( 'blog-sidebar-layout', 'archive-sidebar-layout', 'search-sidebar-layout' ) ) ) {
$option = 'main-layout';
}
$value = magplus_get_post_opt( $option.'-local', (int)$page_id );
$local = true;
//get local from metaboxes for the post value and override if not empty
} else if (is_singular()) {
$value = magplus_get_post_opt( $option.'-local' );
//print_r($value);
$local = true;
}
//return local value if exists
if ($local === true) {
//if $value is an array we need to check if first element is not empty before we return $value
$first_element = null;
if (is_array($value)) {
$first_element = reset($value);
}
if (is_string($value) && (strlen($value) > 0 || !empty($value)) || is_array($value) && !empty($first_element)) {
return $value;
}
}
if (isset($magplus_theme_options[$option])) {
return $magplus_theme_options[$option];
}
return false;
}
}
Thanks,
Kiran