• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

how to style single post and page titles

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › how to style single post and page titles

This topic is: not resolved

Tagged: page titles, single post titles

  • This topic has 4 replies, 2 voices, and was last updated 12 years, 9 months ago by Jan Ruehling.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 22, 2013 at 6:38 pm #42273
    sido
    Member

    I am trying to style my .single .entry-title (http://www.youmeandfivebucks.com/free-to-be-me/) and my .page .entry-title (http://www.youmeandfivebucks.com/about/) to look like the .entry-title and .widgettitle on my homepage (http://www.youmeandfivebucks.com/) --meaning the titles have a lined background with a white background behind the text. Can anyone help? I've been driving myself crazy for the past two days trying to figure it out. Thank you!

    http://www.youmeandfivebucks.com
    May 24, 2013 at 9:06 am #42478
    Jan Ruehling
    Member

    Hello Sido,

    you are missing a sub-class in the title on your singleposts / -pages.

    Code Homepage:

    <h2 class="entry-title">
     <a href="http://www.youmeandfivebucks.com/free-to-be-me/" title="free to be me" rel="bookmark">free to be me</a>
     </h2>

    Code other pages:

    <h1 class="entry-title">
     About
     </h1>

    The .entry-title has the striped background ... but the white background in the middle comes from the <a> - tag ... and that's missing in #2

    You have to edit your loop (single.php && page.php) to

    1) add an <a> tag around the title (

    <h1 class="entry-title"><a>About</a></h1>

    )  ... this is an ugly solution since the color will change as clickable link on hover ... OR

    2) add a <span> around the title (

    <h1 class="entry-title"><span>About</span></h1>

    ) and style it in your (Child)theme style.css:

    .entry-title span {
     background: white;
     } 

    OR

    3) add a <span class="white"> around the title and add this in the style.css

    .white {
     background: white;
     }

    Example loop-change solution #3:

    In single.php of your (child)theme (create if it does not exist):

    <?php
     function jr_change_post_title() {
     ?>
     <h1 class="entry-title"><span class="white"><?php the_title(); ?></span></h1>
     }
     remove_action('genesis_post_title', 'genesis_do_post_title);
     add_action('genesis_post_title', 'jr_change_post_title');
    
    /* Other code here */
    
    genesis();
    
    

    Hope that works for you ...

    May 24, 2013 at 11:21 am #42497
    sido
    Member

    Thank you so so much, Jan! I tried option #2, which worked perfectly in getting the white background on all post/page titles just the way I want. I added the following code to the genesis_post_title_hook :

    <h1 class="entry-title"><span><?php the_title(); ?></span></h1>

    The only problem that came up now is that the post titles on my homepage are not permalinks anymore. Any way to fix that?

    May 24, 2013 at 11:30 am #42498
    Jan Ruehling
    Member
    
    <?php
    
    function jr_change_post_title() {
      if(  is_home() == false  ) {
       echo '<h1 class="entry-title"><span><?php the_title(); ?></span></h1>';
     } // end if statement 
    } // end function
    remove_action('genesis_post_title', 'genesis_do_post_title);
    add_action('genesis_post_title', 'jr_change_post_title');
     
    /* Other code here */
     
    genesis();
    
    May 24, 2013 at 11:46 am #42502
    Jan Ruehling
    Member

    Ok ... wrong thought:

    Try this:

    
    function jr_change_post_title() {
       echo '<h1 class="entry-title"><span><?php the_title(); ?></span></h1>';
    } // end function
    if(  is_home() == false  ) {
        remove_action('genesis_post_title', 'genesis_do_post_title);
        add_action('genesis_post_title', 'jr_change_post_title');
    } // end if statement
    
    /* Other code here */
    
    genesis();
    
  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble