use body class in single page the class is “single” whereas in all other pages its different??
Hi Virendra930, thank you so much, but I am sorry I made a mistake. I didn’t mean in single pages, but single posts, will that be different?
I am using twenty twelve theme, do you know where should I look for body class? Thanks.
yes neverhurry .single class is for single post only or you can find its code in single.php in your theme
Thanks esmi, i do have created a child theme.
virendra930, I have checked the single.php but I didn’t find .single class there. I am using twenty twelve theme.
Anybody knows what is the code for condition “If any single Post, then…” ?
I found in content.php of twenty twelve theme these codes:
<?php if ( is_search() ) : // Only display Excerpts for Search ?><br />
<div class="entry-summary"><br />
<?php the_excerpt(); ?><br />
</div><!-- .entry-summary --><br />
<?php else : ?><br />
<div class="entry-content"><br />
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?><br />
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?><br />
</div><!-- .entry-content --><br />
<?php endif; ?>
Now what I think logically, if I could only write a condition code – “If any single Post – after “<?php else : ?>”
Hi, I am not sure, I have no confidence, if the following codes are OK, pls help:
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php elseif ( is_single() ) : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
Are you using a child theme?
Thanks ESMI, I tried it, it works!
Hi can anyone tell me how to hide the contents of a page using “page-id” ?