- This topic has 21 replies, 4 voices, and was last updated 2 years, 5 months ago by
Tom.
-
AuthorPosts
-
March 15, 2016 at 12:01 pm #179553
Hftt
Hi Tom
The snippet you provided from reply – https://generatepress.com/forums/topic/full-width-title-on-single-post-page/#post-109517 is not working anymore on latest GP version.
Could you please help me to get back for full width title for single posts and pages?
Thanks always.
March 15, 2016 at 2:06 pm #179576Hftt
Sorry Tom
It’s my bad.
I forgot to add title output using generate_after_header hook at functions.php.
It’s OK now. π
March 15, 2016 at 5:19 pm #179598Tom
Lead DeveloperLead DeveloperGlad you sorted it out π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 23, 2018 at 1:29 pm #631004Perrin
Hey Tom π
Trying to get this done, but no matter what I do, both titles either appear or disappear completely. :/
Here’s the PHP added (includes both sets of PHP):
add_filter( 'the_title', 'generate_remove_page_titles', 10, 2 ); function generate_remove_page_titles( $title, $id = null ) { global $post, $generate_content_filter_completed; if ( $generate_content_filter_completed ) { return $title; } if ( ( is_page() || is_single() ) && in_the_loop() && $title == $post->post_title ) return ''; return $title; } add_filter( 'the_content', 'generate_content_filter_completed' ); function generate_content_filter_completed( $content ) { global $generate_content_filter_completed; $generate_content_filter_completed = true; return $content; } add_action('generate_after_header','generate_add_title_below_header'); function generate_add_title_below_header() { // If we're not on a page, don't do anything if ( is_page() || is_single() ) { ?> <div class="page-header-content generate-page-header generate-content-header page-header-title"> <div class="inside-page-header-container inside-content-header grid-container grid-parent"> <header class="entry-header"> <h1 class="entry-title" itemprop="headline"><?php the_title(); ?></h1> </header><!-- .entry-header --> </div> </div> <?php } }
And here’s the CSS added:
.page .entry-content, .single .entry-content { margin-top: 0; } .page .entry-header, .single .entry-title { display:none; }
Any ideas?
July 23, 2018 at 7:23 pm #631143Tom
Lead DeveloperLead DeveloperIt might be worth checking out GPP 1.7 (currently a release candidate): https://generatepress.com/gp-premium-1-7/
It allows you to create a “Page Hero” which can include the title of the current page. Adding it will automatically remove the default title.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 24, 2018 at 8:37 am #631631Perrin
Worked swimmingly. You’re a hell of a guy, Tom. A hell of a guy.
July 24, 2018 at 9:54 am #631723Tom
Lead DeveloperLead DeveloperGlad I could help! π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.