GD Details page can't change sidebar

This topic contains 22 replies, has 4 voices, and was last updated by  digitalbranddesign 4 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #536297

    digitalbranddesign
    Free User
    Post count: 11

    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.

    #536314

    Kor
    Moderator
    Post count: 16516

    Hi 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/

    #536317

    digitalbranddesign
    Free User
    Post count: 11

    So i need to learn php in order to change the sidebar?

    #536318

    Kor
    Moderator
    Post count: 16516

    Hi 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?

    #536320

    digitalbranddesign
    Free User
    Post count: 11
    This reply has been marked as private.
    #536327

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #536423

    Kiran
    Moderator
    Post count: 7069

    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

    #536458

    digitalbranddesign
    Free User
    Post count: 11

    Thank you so much Kiran, do you know what file I would add this to or change? page.php maybe?

    #536461

    Kiran
    Moderator
    Post count: 7069

    Hello,

    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

    #536745

    digitalbranddesign
    Free User
    Post count: 11

    Hi there, when I add this code it gives me a critical error on the website

    #536747

    Kiran
    Moderator
    Post count: 7069

    Provide us FTP credentials and also tell where you added the code.

    Kiran

    #536750

    digitalbranddesign
    Free User
    Post count: 11
    This reply has been marked as private.
    #536759

    Kiran
    Moderator
    Post count: 7069

    Please check and let us know.

    Kiran

    #536770

    digitalbranddesign
    Free User
    Post count: 11

    That works now thank you for all your help.

    #537318

    digitalbranddesign
    Free User
    Post count: 11

    Hi 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?

Viewing 15 posts - 1 through 15 (of 23 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket