Support » Plugins and Hacks » [Resolved] Coding Question on statement if..else

[Resolved] Coding Question on statement if..else

  • 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() ) {
    else {
             if ($this->options['kill_inline'])
                $inline = '' ;
                $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 ?


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'>" ;
    echo "</div>" ;

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

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