How To Add Content After Single Post Titles In Genesis

This post will give you several options you can choose from to display any type of content after all single posts titles.

Note: This PHP code only works with Genesis child themes running HTML 5. Please copy ALL the code and paste it at the end of your child themes functions.php file using a text editor like Notepad++

After Title But Before Entry Meta

function after_title_text() {
if(is_single() ) {
    echo '<h4 class="single-title">Add content after your titles but before your content here</h4>';
}}
add_action('genesis_entry_header', 'after_title_text', 11 );

before post info

After Title & After Entry Meta

function after_title_text() {
if(is_single() ) {
    echo '<div class="single-title">Add content after your titles but before your content here</div>';
}}
add_action('genesis_entry_header', 'after_title_text', 11 );

after post info

Add Text After Entry Titles

Add Widget After Entry Title

genesis_register_sidebar( array(
	'id'          => 'after-title',
	'name'        => __( 'After Title', 'theme' ),
	'description' => __( 'This is the after title widget area.', 'theme' ),
) );
add_action('genesis_entry_header', 'after_title_widget', 11 );
function after_title_widget() {
	if ( is_singular( 'post' ) )
		genesis_widget_area( 'after-title', array(
			'before' => '<div class="after-title widget-area">',
			'after'  => '</div>',
		) );

}

Simply change the 3rd parameter from 11 to 12 if you want to output the widget content after the entry meta (post info).

Widget After Entry Title For Posts In 1 Category

Replace your-category-slug with the slug or I.D for your category.

Related Posts


Comments

11 responses to “How To Add Content After Single Post Titles In Genesis”

  1. […] already shown you how to add text after your titles in Genesis, but how about in other […]

  2. Mark Fayard Avatar
    Mark Fayard

    Hi Brad, would this work for adding content after Featured Widget Titles? For instance I’d like View More to appear after my Featured Posts titles on the homepage only.

    Thank you for your tutorials and time devoted to the Genesis developer community – much appreciated!

    1. Brad Dalton Avatar
      Brad Dalton

      Hello Mark

      I assume you’re referring to the Genesis Featured Posts widget which is coded separately.

      What you can do is create you own featured posts widget and modify the code.

      If you want to filter the widgets title, you can add the read more link after the title ( Code not written at this point in time )

      [code]
      $args[‘before_title’] . apply_filters( ‘widget_title’, $instance[‘title’], $instance, $this->id_base ) . $args[‘after_title’];
      [/code]

      Thanks

      1. Mark Fayard Avatar
        Mark Fayard

        Thank you Brad. If it’s not something I can figure out, is it something I can hire you for? If so are you available and what is your estimated fee.

        In the topmost Sandbox Featured Widget I’ve used the Widget title (View More) in addition to displaying the title post. This is a hack though and requires separate CSS for both titles.

        1. Brad Dalton Avatar
          Brad Dalton

          Please use the contact form if you want to hire me to fix this for you. Thanks

  3. Hi Brad,

    If I read it right, the text is the same for all posts. Then, I can’t think of something useful to put there. However, your tutorial pushed me in the direction of the post byline that I wanted to implement for a while.

    I used Advanced Custom Fields plugin (very well documented) and hooked the custom field output to Genesis.But I gather a skilled developer can create everything manually.

    Thanks for the idea!
    Vadim

    1. Brad Dalton Avatar
      Brad Dalton

      Great idea. This will enable you to add unique content after all single post titles.

    2. How did you hooked custom field output to Genesis ?

      1. Brad Dalton Avatar
        Brad Dalton

        This post has nothing to do with custom fields however i have already written several posts which include using custom fields with genesis so you can find the code to see how its done which is very basic.

  4. Thank you SO much Brad!!! (once again)

    – Mike

    1. Brad Dalton Avatar
      Brad Dalton

      No problem Mike. Always happy to help.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.