is_single( array( 'beef-stew', 'pea-soup', 'chili' ) )
i guys this is the code?
I’m really not good at php, but is it like this then:
<?php if(has_post_thumbnail(is_single( array( 'beef-stew', 'pea-soup', 'chili' ) ) )) { ?>
<?php the_post_thumbnail('homeblog'); ?>
<?php } ?>
??
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
That code would only show post thumbnails on single posts with the slugs beef-stew’ or pea-soup, yes.
I have a page named “contact” so the could so be:
<?php if(has_post_thumbnail(is_single( array( 'contact' ) ) )) { ?>
<?php the_post_thumbnail('homeblog'); ?>
<?php } ?>
But it’s not working :/
[No bumping. If it’s that urgent, consider hiring someone.]
Try:
<?php if( is_single( 'contact') && has_post_thumbnail() ) the_post_thumbnail('homeblog');?>
It does not seem to work 🙁
The code is placed in top_info.php, can that have anything to say?
what should I put instead of homeblog?
Thank you very much for your help!
can that have anything to say
Possibly. What theme are you using?
have a page named “contact”
for pages, use is_page()
http://codex.ww.wp.xz.cn/Function_Reference/is_page
Thank you both so much!!!
The code is working:
<?php if( is_page('contact') && has_post_thumbnail() ) the_post_thumbnail('somethingrandomiguess');?>