Community Forums › Forums › Archived Forums › Design Tips and Tricks › Post Titles No Longer Displayed
Tagged: moving titles, post meta, titles
- This topic has 5 replies, 2 voices, and was last updated 7 years, 9 months ago by paul-useraid.
-
AuthorPosts
-
December 12, 2016 at 10:44 am #197470paul-useraidMember
All was working...but now my post titles (on single posts) are missing from the site. Maybe an upgrade to WordPress or to the Genesis parent theme has changed the support. The post titles are no longer output on single posts. I'm using a customized version of the Parallax Pro child theme.
In functions.php of the child theme, I've used the following code to move the post title above the content (so the title can be full width above the content-sidebar configuration). Even if I comment out this code, I no longer get a page title output on the page...any help would be appreciated:
//* ****** On single post, move post title before entry content (it will be full width) *************
http://www.lzlabs.com
add_action( 'genesis_before_content', 'ua_move_entry_title' );
function ua_move_entry_title() {
if ( is_singular( 'post' ) ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_before_content', 'genesis_do_post_title', 8 );
}
}December 12, 2016 at 11:03 am #197471Victor FontModeratorI went to your news releases page and the post titles are displaying just fine.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 12, 2016 at 11:43 am #197476paul-useraidMemberThe issue is on the individual post page (not the listing of posts). For example, on the following page, notice that no heading is displayed:
http://www.lzlabs.com/perfect_storm/
It should show A Perfect Storm below the breadcrumbs and above the two-column content-sidebar.
The issue is with the line:
add_action( 'genesis_before_content', 'genesis_do_post_title', 8 );If I replace this line with a simple ECHO statement, that information is inserted in the correct location of the page.
Thank you for any help you can offer!
December 12, 2016 at 2:46 pm #197485Victor FontModeratorPlease take a look at the Genesis function:
function genesis() { get_header(); do_action( 'genesis_before_content_sidebar_wrap' ); genesis_markup( array( 'open' => '<div %s>', 'context' => 'content-sidebar-wrap', ) ); do_action( 'genesis_before_content' ); genesis_markup( array( 'open' => '<main %s>', 'context' => 'content', ) ); do_action( 'genesis_before_loop' ); do_action( 'genesis_loop' ); do_action( 'genesis_after_loop' ); genesis_markup( array( 'close' => '</main>', // End .content. 'context' => 'content', ) ); do_action( 'genesis_after_content' ); genesis_markup( array( 'close' => '</div>', 'context' => 'content-sidebar-wrap', ) ); do_action( 'genesis_after_content_sidebar_wrap' ); get_footer(); }
If you are using the standard single page template with Parallax Pro, this is the code that executes when a single blog post displays. The genesis_do_post_title is a loop function. It executes within the loop. If you look at the code above, the loop does not start until well after the genesis_before_content hook fires. This means moving the post title into the before content hook won't do anything because the the function has nothing to grab onto. The post title is available during the loop.
The alternative I see is to play with the genesis structural wraps or class attributes. Perhaps add a structural wrap or class to the entry content area and adjust the padding there instead of the content class.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 12, 2016 at 3:05 pm #197486paul-useraidMemberI don't believe that is the issue, but I could be wrong. This approach was working actually at the beginning of November, so it is a change that was rolled out since then that affected it.
Also, I found the following article that does this same thing (outside the loop) and it works (I even tried using 'genesis_before_content_sidebar_wrap' instead of genesis_before_content) ...so I'm not sure why my implementation is different:
wpsites.net/web-design/reposition-title-before-content-sidebar-wrap-like-the-nytimes-post-layout/
//* Reposition the entry title (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_post_title', 2 );Any other ideas?
December 12, 2016 at 3:41 pm #197489paul-useraidMemberOK, you got me thinking about what information is available when. I then noticed that in the article I linked in my last comment, it used get_header in the add_action... so this works:
add_action( 'get_header', 'ua_move_single_post_title' );
function ua_move_single_post_title() {
if ( is_singular( 'post' ) ) :
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
add_action( 'genesis_before_content', 'genesis_entry_header_markup_open', 5 );
add_action( 'genesis_before_content', 'genesis_do_post_title' );
add_action( 'genesis_before_content', 'genesis_entry_header_markup_close', 15 );
endif;
}Thank you for your help!!
-
AuthorPosts
- The topic ‘Post Titles No Longer Displayed’ is closed to new replies.