Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hey guys, please please help :)

I have a function in this pastie code http://www.pastie.org/4276093 and I need to place this piece of code:

<?php if (in_category('featured')) : ?>
<a href="<?php the_permalink(); ?>">  <span  class="featured_icon">     
<img src="<?php bloginfo('template_directory'); ?>/images/featured_icon.png" />  
</span></a>                     
<?php endif; ?>

between line 16 and 19 from the pastie code: http://www.pastie.org/4276093! Can anyone please help, cause I don't know how to add "if the post is in category" to the function I have.

share|improve this question
What happened when you pasted the function from your other question into functions.php and then added that function's output to your display? – fdsa Jul 19 '12 at 0:10
@fdsa i placed this in the plugins function: $display.= displayImage($post->ID) and it gave me this: Parse error: syntax error, unexpected T_VARIABLE – jimilesku Jul 19 '12 at 11:27
I tried to fix it by placing the ; after the (post->ID) but the primary function has <php code, and its not working. How to replace <?php bloginfo ... with something that doesn't show up as an error in function? I need the featured badge to appear somehow on the posts that are in featured category :) – jimilesku Jul 19 '12 at 11:40
Can you make a new pastie where you show the code that's causing the error? – fdsa Jul 19 '12 at 22:03

closed as too localized by toscho Sep 18 '12 at 3:47

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.