• Resolved iamcracks

    (@iamcracks)


    I’m trying to use the new thumbnail feature only on Sticky posts. So an if is_sticky seems like the obvious solution, but I’m having grief with the php and html all inside the ‘if is’. But there’s too many ‘ and ” and I don’t know the correct protocol when they’re all present.

    I want this ……

    <a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_post_thumbnail(array(200,200), array('class' => ' fR')); ?></a>

    …… to call only if post = sticky.

    Anyone ..?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Is this what you mean?

    <?php if( is_sticky() ) : ?>
    // YOUR CODE GOES HERE
    <?php endif; ?>

    Thread Starter iamcracks

    (@iamcracks)

    Yes, it is. I sure was trying to do it the hard way. You way is way easier. Thanks.

    I was using someone else’s code which was riddled with echo 'xxx' php echo '' etc. Obviously unnecessary.

    Thanks for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Code Question – How To php if with html & php inclusive’ is closed to new replies.