• 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 create and reuse a word in H3 format?

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 create and reuse a word in H3 format?

This topic is: resolved

Tagged: Colors, dynamic, H3, reuse

  • This topic has 7 replies, 2 voices, and was last updated 12 years, 3 months ago by pamrburke.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • November 16, 2013 at 3:13 pm #73456
    pamrburke
    Member

    In my site title I have formatted it canwillDONE, such that can is gray, will is orange, and DONE is a very dark gray.

    There will be times that I will use canwillDONE in a H3, such as canwillDONE Mission, and I want canwillDONE to be formatted like above, but all the other words in the H3 to the default body color. Is using the dashboard text area the only way to do this, or is it something that can be programmed in the function.php, then have a CSS created for it?

    Thanks

    Pam

    http://www.canwilldone.com
    November 16, 2013 at 11:30 pm #73517
    nutsandbolts
    Member

    You could create a shortcode for it. Put this in your functions.php:

    // Custom canwillDONE Text
    function canwilldone_shortcode() {
            return '<h3><span style="color: #019192;">can</span><span style="color: #017172;">will</span><span style="color: #ED702B;">DONE</span></h3>';
    }
    add_shortcode( 'canwilldone', 'canwilldone_shortcode' );

    Be sure to change each color value above to the correct hex codes for the colors you want. Then you can use [canwilldone] in a page or post and it will display as an H3 with the correct colors.

    Edited to add: This won't work in an entry title, but only as a heading within a page or post. Also, if you want to be able to choose whether or not it displays as H3 or regular-sized text, just take the H3 tags out of the function.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    November 17, 2013 at 10:30 am #73565
    pamrburke
    Member

    Thank You Andrea for responding.

    I added the code to the function area of the Gensis Extender, but there was no change to the text.

    I will also note that I have another function in there for something else, but I gather that should not make a difference.

    Thanks

    Pam

    November 17, 2013 at 10:31 am #73566
    nutsandbolts
    Member

    It won't automatically change existing text - you would need to use the shortcode above in a page or post to see if it's working. It worked on a test site for me with no problem. Can you paste exactly what you put in your functions area?


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    November 17, 2013 at 11:38 am #73571
    pamrburke
    Member

    Hi Andrea,

    Thank You for your help. I got it to work. I am new to all of this, therefore I did not know what shortcodes was.

    After a Google search to learn more about shortcode, I went back to where I had canwilldone, and replaced it with [canwilldone].

    November 17, 2013 at 11:46 am #73573
    pamrburke
    Member

    Andrea,

    I thought this was resolved, but then realized an issue.
    The code is putting the word on its own line, a break after the text before it and a break after the code after it.

    Thanks

    Pam

    November 17, 2013 at 1:22 pm #73670
    nutsandbolts
    Member

    Okay. Take the code I gave you out of functions.php and replace it with this:

    // Custom canwillDONE Text
    function canwilldone_shortcode() {
            return '<span style="color: #019192;">can</span><span style="color: #017172;">will</span><span style="color: #ED702B;">DONE</span>';
    }
    add_shortcode( 'canwilldone', 'canwilldone_shortcode' );

    That removes the H3 tags, so when you use the shortcode, you'll need to highlight it and make it H3 manually if you want it to be a headline. That will prevent it from adding the line breaks on its own.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    November 17, 2013 at 2:30 pm #73793
    pamrburke
    Member

    Andrea,

    That work.

    Thank You.

    Pam

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 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