This topic has 2 replies, 2 voices, and was last updated 8 years by rikbutterflyskull.

  • Author
  • #102126
     rikbutterflyskull
    Participant

    Hi, in “Theme options > Social Share” there is the possibility to select what post types included. While the GeoDirectory gd_place/place is selected, the GD default template is not showing the sharing block.

    I copied the listing-detail.php (plugins/geodirectory/geodirectory-templates) in “kleo-child/geodirectory” and put the code from kleo single.php “get_template_part( ‘page-parts/posts-social-share’ );”.

    Now the social share theme option is full working also with GD Places post type

    Here the listing-detail.php

    COPY CODE
    <?php
    /**
     * Template for the details (post) page
     *
     * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
     *
     * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
     * @since 1.0.0
     * @package GeoDirectory
     */
    
    header("X-XSS-Protection: 0"); // IE requirement
    // call header
    get_header();
    
    ###### WRAPPER OPEN ######
    /** This action is documented in geodirectory-templates/add-listing.php */
    do_action('geodir_wrapper_open', 'details-page', 'geodir-wrapper', '');
    
    ###### TOP CONTENT ######
    /** This action is documented in geodirectory-templates/add-listing.php */
    do_action('geodir_top_content', 'details-page');
    
    /**
     * Calls the top section widget area and the breadcrumbs on the details page.
     *
     * @since 1.1.0
     */
    do_action('geodir_detail_before_main_content');
    
    /** This action is documented in geodirectory-templates/add-listing.php */
    do_action('geodir_before_main_content', 'details-page');
    
    ###### SIDEBAR ON LEFT ######
    if (get_option('geodir_detail_sidebar_left_section')) {
        /**
         * Adds the details page sidebar to the details template page.
         *
         * @since 1.1.0
         */
        do_action('geodir_detail_sidebar');
    }
    
    ###### MAIN CONTENT WRAPPERS OPEN ######
    /** This action is documented in geodirectory-templates/add-listing.php */
    do_action('geodir_wrapper_content_open', 'details-page', 'geodir-wrapper-content', '');
    
    /**
     * Adds the opening HTML wrapper for the article on the details page.
     *
     * @since 1.1.0
     * @since 1.5.4 Removed http://schema.org/LocalBusiness parameter as its now added via JSON-LD
     * @global object $post The current post object.
     * @global object $post_images Image objects of current post if available.
     * @param string $type Page type.
     * @param string $id The id of the HTML element.
     * @param string $class The class of the HTML element.
     * @param string $itemtype The itemtype value of the HTML element.
     * @see 'geodir_article_close'
     */
    do_action('geodir_article_open', 'details-page', 'post-' . get_the_ID(), get_post_class(), '');
    
    ###### MAIN CONTENT ######
    // this call the main page content
    if (have_posts() && !$preview) {
        the_post();
        global $post, $post_images;
        /**
         * Calls the details page main content on the details template page.
         *
         * @since 1.1.0
         * @param object $post The current post object.
         */
        do_action('geodir_details_main_content', $post);
    } elseif ($preview) {
        /**
         * Called on the details page if the page is being previewed.
         *
         * This sets the value of <code>$post</code> to the preview values before the main content is called.
         *
         * @since 1.1.0
         */
        do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
        /** This action is documented in geodirectory-templates/listing-detail.php */
        do_action('geodir_details_main_content', $post);
    }
    
    ###### MAIN CONTENT WRAPPERS CLOSE ######
    /**
     * Adds the closing HTML wrapper for the article on the details page.
     *
     * @since 1.1.0
     * @param string $type Page type.
     * @see 'geodir_article_open'
     */
    do_action('geodir_article_close', 'details-page');
    
    /** This action is documented in geodirectory-templates/add-listing.php */
    do_action('geodir_after_main_content');
    
    get_template_part( 'page-parts/posts-social-share' );
    
    /** This action is documented in geodirectory-templates/add-listing.php */
    do_action('geodir_wrapper_content_close', 'details-page');
    
    ###### SIDEBAR ON RIGHT ######
    if (!get_option('geodir_detail_sidebar_left_section')) {
        /** This action is documented in geodirectory-templates/listing-detail.php */
        do_action('geodir_detail_sidebar');
    }
    
    ###### WRAPPER CLOSE ######	
    /** This action is documented in geodirectory-templates/add-listing.php */
    do_action('geodir_wrapper_close', 'details-page');
    
    ###### BOTTOM SECTION WIDGET AREA ######
    /**
     * Adds the details page bottom section widget area to the details template page.
     *
     * @since 1.1.0
     */
    do_action('geodir_sidebar_detail_bottom_section', '');
    
    get_footer();
    Attachments:
    You must be logged in to view attached files.
    #102136
     sharmstr
    Moderator

    You dont have to do that in Kleo 4.0.

    In the meantime, you can just do this

    COPY CODE
    
    add_action('geodir_details_main_content', 'add_social_sharing', 35);
    
    function add_social_sharing() {
    
        get_template_part( 'page-parts/posts-social-share' );
    
    }
    
    

    or this

    COPY CODE
    
    add_action('geodir_article_close','kleo_geodir_social_share');
    function kleo_geodir_social_share() {
        get_template_part( 'page-parts/posts-social-share' );
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #102143
     rikbutterflyskull
    Participant

    Oh many thanks

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?