Add Website Link in Listing Page

This topic contains 4 replies, has 4 voices, and was last updated by  Kiran 6 years, 9 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #388723

    Mike Hampton
    Expired Member
    Post count: 40

    Hi,

    I was wondering if it’s possible to add the website link for the “partner cpt” that I have created so that it shows underneath the “pinpoint” section on the listings page https://portheden.org/partners/ ?

    I’ve also disabled the address section of this CPT so don’t acually need the pinpoint marker/link to show there as well.

    Please instruct of what code/css to change/add.

    Many Thanks

    Mike

    #388741

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    1) Go to Partner settings, double click on the website field and in the option “show in what location”, select : Listing page

    2) this in a code snippet should do it:

    remove_action('geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1);

    Let us know how it goes,

    Thanks

    #388842

    Mike Hampton
    Expired Member
    Post count: 40

    Hi Paulo,

    Thanks. I’ve done 1) and it added the link to the listings page, though having done 2) I still see the pinpoint market in the listings page when there is no address data or map on the partners CPT….

    Would be good if when deselecting address field in options it automatically removes the pinpoint as well. If can advise on this please.

    I am only looking to remove the pinpoint for Partners CPT, not on other listings pages where address data and maps are present.

    Thanks
    Mike

    #388884

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Mike,

    I have added this as a bug and it will be fixed in the next release.

    Thanks,

    Stiofan

    #389132

    Kiran
    Moderator
    Post count: 7069

    Hi Mike,

    The problem has been fixed and will be reflected in next release of Custom Post Types plugin.

    You can put following code at the end of file plugins/geodir_custom_posts/geodir_cp_hooks_actions.php to get reflected fix from right now

    
    
    function geodir_check_listing_pinpoint() {
        global $wp_query;
        
        if ( !empty( $wp_query ) && $wp_query->is_main_query() ) {
            if ( ! empty( $_REQUEST['geodir_search'] ) && ! empty( $_REQUEST['stype'] ) ) {
                $post_type = sanitize_text_field( $_REQUEST['stype'] );
            } else {
                $post_type = get_query_var( 'post_type' );
            }
    
            if ( $post_type && geodir_cpt_no_location( $post_type ) ) {
                remove_action( 'geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2 );
            }
        }
    }
    add_action( 'template_redirect', 'geodir_check_listing_pinpoint', 10 );

    Thanks,
    Kiran

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

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

Open Support Ticket