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 );
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 );
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.
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!
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 )
Thanks
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.
Please use the contact form if you want to hire me to fix this for you. Thanks
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
Great idea. This will enable you to add unique content after all single post titles.
How did you hooked custom field output to Genesis ?
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.
Thank you SO much Brad!!! (once again)
– Mike
No problem Mike. Always happy to help.