Archived topic
Single Page PHP
3 replies · Started by Ryan on July 11, 2016
Hi,
On my site http://shortdailydevotions.com, I have moved the post title to the header and hidden the post title in the content via css. This is what I use in the GP hooks
<?php if ( is_single() ) : ?>
<div class="page-header-content generate-page-header generate-content-header">
<div class="grid-container">
<div class="above-header-title"> <center><?php single_post_title(); ?></center></div>
</div>
</div>
<?php endif; ?>
I would also like to do this for the single pages. I have tried a couple things, but every time it also affects the archive page. Do you know what I need to do for is_single and single_post_title for a single page?
Thanks,
Ryan
Hi Ryan,
Try this code:
<?php if ( is_single() || is_page() ) : ?>
<div class="page-header-content generate-page-header generate-content-header">
<div class="grid-container">
<div class="above-header-title" style="text-align:center"><?php the_title(); ?></div>
</div>
</div>
<?php endif; ?>
Thanks, that worked perfect! I would like to just say thanks for an awesome theme and awesome support. I have used multiple themes over the years and I am usually pretty good at figuring out css or finding some php snippet to do what I need. Your theme is super easy to get the look I like with just a little bit of custom css.
Glad I could help!
Thank you! I'm glad you're enjoying the theme :)
