Black Friday Sale! Get up to $30 off GP Premium! Learn more ➝

[Resolved] Single Page PHP

Home Forums Support [Resolved] Single Page PHP

Home Forums Support Single Page PHP

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #208333
    Ryan

    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

    #208336
    Tom
    Lead Developer
    Lead Developer

    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; ?>
    #208352
    Ryan

    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.

    #208425
    Tom
    Lead Developer
    Lead Developer

    Glad I could help!

    Thank you! I’m glad you’re enjoying the theme 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.