Image instead of slider not showing in preview page

This topic contains 3 replies, has 3 voices, and was last updated by  Roelien 4 years ago.

  • Author
    Posts
  • #361300

    Roelien
    Expired Member
    Post count: 7

    Hi,

    I have removed the slider and replaced it with the featured image with this code:

    
    
    remove_action( 'geodir_details_main_content','geodir_action_details_slider',30);
    
    add_action( 'geodir_details_main_content','my_geodir_action_details_slider',30);
    
    function my_geodir_action_details_slider() {
    
    if ( has_post_thumbnail() ) { the_post_thumbnail('full');
    } 
    }

    The featured image is not showing in the preview listing page. Can you help me solve this?

    #361477

    Kor
    Moderator
    Post count: 16516

    Hi there,

    I’ve just checked your Website and I’m able to see the image as shown in this screenshot http://prntscr.com/e8psqh . Did you somehow figured it out?

    Thanks!

    #361483

    Stiofan O’Connor
    Site Admin
    Post count: 22954

    Hello,

    Try something like this:

    remove_action( ‘geodir_details_main_content’,’geodir_action_details_slider’,30);

    
    
    add_action( 'geodir_details_main_content','my_geodir_action_details_slider',30);
    
    function my_geodir_action_details_slider() {
    
    	global $preview,$post;
    
    	if($preview){
    		$post_images = array();
    		if (isset($post->post_images) && !empty($post->post_images)) {
    			$post->post_images = trim($post->post_images, ",");
    			$post_images = explode(",", $post->post_images);
    
    			echo "<img src='".$post_images[0]."' />";
    		}
    	}
    	elseif ( has_post_thumbnail() ) { the_post_thumbnail('full');
    	}
    }

    Thanks,

    Stiofan

    #361553

    Roelien
    Expired Member
    Post count: 7

    Hi Stiofan,

    It worked! Thanks a lot for your help!

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

The topic ‘Image instead of slider not showing in preview page’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.