GD Details page can't change sidebar
This topic contains 22 replies, has 4 voices, and was last updated by digitalbranddesign 4 years, 7 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: GD details, MagPlus, sidebar, snippet
-
AuthorPosts
-
March 23, 2020 at 2:46 pm #536297
I have managed to set no sidebar for the GD Home page but for the details page it won’t allow me to change to a new sidebar I have made even though it is selected.
There is no page attributes that would work and where I change the sidebar is part of the theme – MagPlus.
Here is url for main page which leads to mockup pages – https://fishfocus.co.uk/directory/
Each listing page has the wrong sidebar even though the correct one is selected on the screenshot provided. All page attributes are from either the theme or other plugins of which none make the sidebar appear.
March 23, 2020 at 4:06 pm #536314Hi digitalbranddesign,
Thanks for your post. If you’re trying to apply the same sidebar to all your listings, you can edit the GD Details Template here https://wpgeodirectory.com/docs-v2/templates/details/
March 23, 2020 at 4:10 pm #536317So i need to learn php in order to change the sidebar?
March 23, 2020 at 4:48 pm #536318Hi digitalbranddesign,
Thanks for your reply. Could you share your Website WP admin access here in private reply so that I could check your GD setup?
March 23, 2020 at 4:52 pm #536320This reply has been marked as private.March 23, 2020 at 6:17 pm #536327This reply has been marked as private.March 24, 2020 at 6:49 am #536423Hello 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,
KiranMarch 24, 2020 at 11:49 am #536458Thank you so much Kiran, do you know what file I would add this to or change? page.php maybe?
March 24, 2020 at 11:56 am #536461Hello,
PHP snippet can be executed by adding via PHP snippet plugin or by adding in current theme functions.php file.
For more info check this https://wpgeodirectory.com/docs/useful-plugins/#snippets
Kiran
March 25, 2020 at 3:00 pm #536745Hi there, when I add this code it gives me a critical error on the website
March 25, 2020 at 3:20 pm #536747Provide us FTP credentials and also tell where you added the code.
Kiran
March 25, 2020 at 3:28 pm #536750This reply has been marked as private.March 25, 2020 at 4:09 pm #536759Please check and let us know.
Kiran
March 25, 2020 at 5:25 pm #536770That works now thank you for all your help.
March 29, 2020 at 7:07 pm #537318Hi there is another issue, on the opening hours for each listing/place when we select a time it comes up a calendar rather than time slots? Is that wrong?
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket