• 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

Altitude-pro – add conditional Div wrapper to entry-title h1

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 › Altitude-pro – add conditional Div wrapper to entry-title h1

This topic is: resolved

Tagged: Altitude Pro

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 6 months ago by Susan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 25, 2015 at 10:44 pm #163521
    lorilin
    Member

    Hi folks,

    I have a custom body class that is working well to let me change the entry-title h1 color. I'd like to add a div wrapper with a translucent background color for the entry-title h1 for that body class. The effect I'm going for you can see below (ignore the ugly background image).

    http://www.w3schools.com/css/tryit.asp?filename=trycss_transparency

    and paste in the code to see it:

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    div.background
    {
      background: url(klematis.jpg) repeat;
      border: 2px solid black;
    }
    div.transbox
    {
      margin: 40px 0px;
      background-color: rgba(0,0,0,0.6);
      border: 1px solid black;
     padding:20px;
    }
    div.transbox p
    {
      margin: 5%;
      font-weight: bold;
      color: #fff;
    font-size:40px;
    font-family:sans-serif;}
    </style>
    </head>
    <body><div class="background">
    <div class="transbox">
    <p>This is some text that is placed in the transparent box.</p>
    </div>
    </div>
    </body>
    </html>

    I am pretty sure I just need to add something to functions.php and then the styling to style.css, but can't figure out how to target just certain entry-title h1's and add the extra div around them. Once I have that going I can add the styling.

    I was messing around with the code I found on another post here (below) but got nowhere:

    /**
    * Add Wrapper to the entry title
    */
    add_action( 'genesis_after_header', 'gs_create_black_title_banner' );
    function gs_create_black_title_banner()
    {if ( has_tag('blacktitle'))
    echo '<div class="blackwrapper"><h1 class="entry-title" itemprop="headline">';
    echo get_the_title();
    echo '</h1></div>';
    }

    Any tips?

    October 10, 2015 at 10:56 pm #167840
    Susan
    Moderator

    I am closing this, as you have marked it resolved. If you are still having issues, please go ahead and start another thread.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Altitude-pro – add conditional Div wrapper to entry-title h1’ is closed to new 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