Show in what location: Above tabs but below image slider

This topic contains 4 replies, has 4 voices, and was last updated by  Scott Harris 5 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #448570

    Scott Harris
    Lifetime Member
    Post count: 74

    Last year GD wrote this great blog post that helped us add custom fields to different places in the detail pages https://wpgeodirectory.com/custom-fields-custom-places/.

    If possible, I’d like to be able to add custom fields both above the image slider at the top and also below the image slider but above the tabs. If that’s possible, could you provide us with the snippets?

    #448587

    Kor
    Moderator
    Post count: 16516

    Hi Scott,

    Thanks for your post. Unfortunately, that would require customization. But I’ll forward this to a developer for a second opinion.

    Thanks!

    #448597

    Kiran
    Moderator
    Post count: 7069

    Hello Scott,

    Use following code snippet to add custom field location as you requested.

    
    
    // Add a new output location to the list of places a custom field can be output.
    function _gd_snippet_custom_field_locations( $show_in_locations, $field_info, $field_type ) {
    	$show_in_locations[ '[above_image_slider]' ] = __( "Above Image Slider", 'geodirectory' ); // Above image slider
    	$show_in_locations[ '[below_image_slider]' ] = __( "Below Image Slider", 'geodirectory' ); // Below image slider
    
    	return $show_in_locations;
    }
    add_filter( 'geodir_show_in_locations', '_gd_snippet_custom_field_locations', 10, 3 );
    
    // Outputs fields above detail page image slider.
    function _gd_snippet_location_above_image_slider() {
    	echo geodir_show_listing_info( 'above_image_slider' );
    }
    add_action( 'geodir_details_main_content', '_gd_snippet_location_above_image_slider', 29 );
    
    // Outputs fields below detail page image slider.
    function _gd_snippet_location_below_image_slider() {
    	echo geodir_show_listing_info( 'below_image_slider' );
    }
    add_action( 'geodir_details_main_content', '_gd_snippet_location_below_image_slider', 31 );

    Add field to positions “Above Image Slider” & “Below Image Slider” from field settings.

    Kiran

    #448656

    Alex Rollin
    Moderator
    Post count: 27815

    Have you used GDV2 templates yet?

    https://wpgeodirectory.com/docs-v2/geodirectory/templates/

    The above modification should not be necessary with V2. Please let us know when you get a chance to try it out.

    #448724

    Scott Harris
    Lifetime Member
    Post count: 74

    Thanks Kiran, Alex and Kor. Once again, kudos to the excellent GD support. You set the standard in tech support.

    Alex, I am looking forward to trying GDV2. However, I depend on most of the GD add-ons and I believe that they are still in beta.

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