Main Listing Images

This topic contains 8 replies, has 6 voices, and was last updated by  Kiran 7 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #445855

    Lee
    Free User
    Post count: 2

    Is there any way I can limit the number of images that show to just one. Yet have more than one show under the photos tab in the listing itself?

    #445860

    Kor
    Moderator
    Post count: 16516

    Hi lee,

    Thanks for your post. You’ll have to use this addon https://wpgeodirectory.com/downloads/payments-manager/ to limit the image uploads. Refer to this section of the documentation for more information https://wpgeodirectory.com/docs/prices-and-payments-add-on-overview/

    #445864

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    not sure i understand, limit it to one where?

    Stiofan

    #445866

    Lee
    Free User
    Post count: 2

    Hey Guys,

    I mean ones you have clicked into a listing you can see at the top all the images that have been uploaded. The ones that are on a slideshow. How can these be limited to just the main image? But still having the other uploaded images show under the photo tab.

    Or failing that, how can I stop those showing entirely.

    #445876

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    U could do something like this (not tested):

    
    
    remove_action('geodir_details_main_content', 'geodir_action_details_slider', 30);
    add_action('geodir_details_main_content', 'the_post_thumbnail', 30);

    Stiofan

    #445879

    Lee
    Free User
    Post count: 2

    Where would this go and I can see this is not CSS. PHP?

    #445890

    Guust
    Moderator
    Post count: 29970

    You can use the Code Snippets plugin for that:
    https://wpgeodirectory.com/docs/useful-plugins/#snippets

    Thanks

    #446031

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

    Kiran
    Moderator
    Post count: 7069

    Hello Lee,

    Try this snippet to display single/default image on detail page.

    
    
    // Display single post image on detail page.
    function _gd_snippet_detail_featured_image( $post ) {
    	if ( ! empty( $post ) ) {
    		$post_images = geodir_get_images( $post->ID, 'thumbnail', true, true, 1 );
    
    		if ( ! empty( $post_images ) ) {
    			$image = $post_images[0];
    			?>
    			<div class="geodir_flex-container" style="text-align:center">
    				<img src="<?php echo $image->src; ?>" alt="<?php echo esc_attr( $image->title ); ?>" title="<?php echo esc_attr( $image->title ); ?>" style="max-height:400px;margin:0 auto;" />
    			</div>
    		<?php
    		}
    	}
    }
    function _gd_snippet_detail_single_image_slider() {
        remove_action( 'geodir_details_main_content', 'geodir_action_details_slider', 30 );
    	add_action( 'geodir_details_main_content', '_gd_snippet_detail_featured_image', 30, 1 );
    }
    add_action( 'plugins_loaded', '_gd_snippet_detail_single_image_slider' );

    Kiran

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount