• 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

add a custom field to conditional h1 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 › add a custom field to conditional h1 titles

This topic is: not resolved

Tagged: conditional, custom field, filter, post title

  • This topic has 3 replies, 3 voices, and was last updated 13 years ago by SoZo.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 1, 2012 at 11:24 pm #2832
    birdonawire55
    Participant

    I've been beating my head against a brick wall on this one. I need to add a 'sub-title' as part of the post title on conditionally selected posts.  While I can filter the titles adding spans for css, I can't seem to grab on to what it is I need to do to get the subtitle custom field to display.  Any help would be appreciated.

    I did find this  snippet  but can't seem to wrap my head around how to get Genesis to output : (if custom field is populated this pulls the value after the h1) <code><? php the_title( get_post_meta($post->ID, 'myCustomField', TRUE) . ': ');</code>

     would Simple hooks be the best route?
    December 2, 2012 at 9:24 am #2847
    Doak Heggeness
    Member

    You need to tell Genesis where to add your code...so in functions.php add......

    add_filter (  'genesis_after_post_title',  'my_function'  ); 

    Hook Reference


    Doak Heggeness, WordPress Development | Website

    December 2, 2012 at 4:49 pm #2917
    birdonawire55
    Participant

    yes I got that no issues.. what I am trying to do however is this:

    H1 TITLE :  Artist Name  I'm thinkin maybe the after post title hook won't do that?

    December 2, 2012 at 5:33 pm #2918
    SoZo
    Member

    It should with some CSS tweaking. Other option is to remove the h1 altogether and replace it with your own code.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

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

© 2025 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