• Resolved avotronicsuk

    (@avotronicsuk)


    Hi,

    I have this in a theme file that outputs the featured images in the archive listing. I’ve added some divs to sit in parallel with the featured image, however, because the image is outputted like below, my DIVS are just overlapping the image when the browser is reduced or using ipad etc.

    <?php
    			if( has_post_thumbnail() ) {
    				$image = '';
    	     		$title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) );
    	     		$image .= '<figure class="post-featured-image">';
    	  			$image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">';
    	  			$image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>';
    	  			$image .= '</figure>';
    
    	  			echo $image;
    	  		}
      			?>

    So I need the $image to be enclosed in a div so I can style it. I think. I don’t know how to do that.

    Please?
    Thanks.
    Danny

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Are you sure it’s not a CSS issue?

    Thread Starter avotronicsuk

    (@avotronicsuk)

    Hi,

    Yes it is css, I’m being a fool.
    I used overflow: auto; and it’s fine now.

    Thanks I have been spending too long staring at this code.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to prevent DIV overlapping image!!!’ is closed to new replies.