add a custom field to conditional h1 titles

Community Forums Forums Design Tips and Tricks add a custom field to conditional h1 titles

This topic is: not resolved

This topic contains 3 replies, has 3 voices, and was last updated by  SoZo 2 years ago.

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

    birdonawire55
    Participant
    Post count: 3

    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?
    #2847

    Doak Heggeness
    Participant
    Post count: 145

    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

    #2917

    birdonawire55
    Participant
    Post count: 3

    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?

    #2918

    SoZo
    Moderator
    Post count: 1573

    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

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.