• Resolved ProgenicRo

    (@progenicro)


    Hi there.
    I’m trying to set the featured images on the posts, and I want to combine them with the adsense leadin.

    I want to make it somehow if there is no featured image, to show up the adsense instead. So i did this:

    if ( has_post_thumbnail() ) {
    the_post_thumbnail();
    }
    else {
             if ($this->options['kill_inline'])
                $inline = '' ;
              else
                $inline = 'style="' . $show_leadin .
                  ';margin:' . $margin . 'px;' . $border. '"' ;
              $leadin =
                stripslashes($this->options['info'] .
                  "<!-- Post[count: " . $this->ezCount . "] -->\n" .
                  '<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
                  $this->options['text_leadin'] .
                  ($this->urCount++ < $this->urMax ? $unreal : '') .
                  "</div>\n" . $this->options['info'] . "\n") ;
    			 }

    This code is working, but the problem is that the featured image appears on the top of the post, and is not alligned just like the adsense block.
    Do I have to insert the thumbnail code of featured image anywhere else to take the place of the adsense block when it exists ?

    http://wordpress.org/extend/plugins/easy-adsense-lite/

Viewing 1 replies (of 1 total)
  • I think you may need to add some styling divs around the the_post_thumbnail(); call. Like this untested code snippet:

    echo "<div style='display:block'>" ;
    the_post_thumbnail();
    echo "</div>" ;

    You will have to play with div style until you get it right.

Viewing 1 replies (of 1 total)
  • The topic ‘Coding Question on statement if..else’ is closed to new replies.