Community Forums › Forums › Archived Forums › General Discussion › Minimum Pro – Replace Site Tagline with Page Title
Tagged: minimum pro
- This topic has 12 replies, 5 voices, and was last updated 10 years, 7 months ago by MarketLeaner.
-
AuthorPosts
-
August 28, 2013 at 5:23 am #59185Timothy MayoMember
I've just installed the new Minimum Pro theme and already find myself looking to make some customisations 🙂
Basically I would like to replace the site tagline with the current page title, and of course then stop the page title from appearing a second time in the body.
Is this possible?
Thanks!
August 29, 2013 at 12:01 am #59433Digital PureMemberI am sure that you need to unregister the "site-tagline" and the "genesis_entry_header" from their normal postions, and then register the genesis_entry_header in the custom site-tagline area. I have been playing around with doing this also, and the css gets all weird on me. I would love to see this working though.
August 29, 2013 at 2:34 am #59471Timothy MayoMemberOk I've found a solution to this, it's most likely not the cleanest, but it seems to work 🙂
I replaced this line in the functions.php:
printf( '<p %s>%s</p>', genesis_attr( 'site-description' ), esc_html( get_bloginfo( 'description' ) ) );
With this one:
printf( '<h1 %s>%s</h1>', genesis_attr( 'entry-title' ), esc_html( get_the_title() ) );
Then also added the following:
//* Remove page titles remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
This does what I was looking for.
I'll leave this open for now in case someone has a more elegant solution.
August 30, 2013 at 7:25 pm #59810scotmMemberGreat idea, though it would be good to have the site-description retained on the home page.
August 30, 2013 at 9:23 pm #59820Digital PureMemberI have not tested this (sorry dev enviro broke this afternoon).
//* Add the site tagline section add_action( 'genesis_after_header', 'minimum_site_tagline' ); if( '!is_home') { function minimum_site_tagline() { printf( '<div %s>', genesis_attr( 'site-tagline' ) ); genesis_structural_wrap( 'site-tagline' ); printf( '<div %s>', genesis_attr( 'site-tagline-left' ) ); printf( '<p %s>%s</p>', genesis_attr( 'site-description' ), esc_html( get_bloginfo( 'description' ) ) ); echo '</div>'; printf( '<div %s>', genesis_attr( 'site-tagline-right' ) ); genesis_widget_area( 'site-tagline-right' ); echo '</div>'; genesis_structural_wrap( 'site-tagline', 'close' ); echo '</div>'; } else { function minimum_site_tagline() { printf( '<div %s>', genesis_attr( 'site-tagline' ) ); genesis_structural_wrap( 'site-tagline' ); printf( '<div %s>', genesis_attr( 'site-tagline-left' ) ); printf( '<h1 %s>%s</h1>', genesis_attr( 'entry-title' ), esc_html( get_the_title() ) ); echo '</div>'; printf( '<div %s>', genesis_attr( 'site-tagline-right' ) ); genesis_widget_area( 'site-tagline-right' ); echo '</div>'; genesis_structural_wrap( 'site-tagline', 'close' ); echo '</div>'; } //* Remove page titles remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); } }
August 31, 2013 at 7:46 am #59892scotmMemberThis looks good, but I think the original solution also removed the titles from the blog posts showing on the home page. Will test this and report back.
August 31, 2013 at 8:13 am #59893scotmMemberNo luck...white screened.
September 3, 2013 at 3:03 pm #60498MarketLeanerMemberSecond jawn was close. Had to play with it. else if(is_page() ) was the main difference and removed repeated function above else line.
add_action( 'genesis_after_header', 'minimum_site_tagline' ); function minimum_site_tagline() { if (is_home() || is_front_page()) { printf( '<div %s>', genesis_attr( 'site-tagline' ) ); genesis_structural_wrap( 'site-tagline' ); printf( '<div %s>', genesis_attr( 'site-tagline-left' ) ); printf( '<p %s>%s</p>', genesis_attr( 'site-description' ), esc_html( get_bloginfo( 'description' ) ) ); echo '</div>'; printf( '<div %s>', genesis_attr( 'site-tagline-right' ) ); genesis_widget_area( 'site-tagline-right' ); echo '</div>'; genesis_structural_wrap( 'site-tagline', 'close' ); echo '</div>';} else if(is_page() ) { printf( '<div %s>', genesis_attr( 'site-tagline' ) ); genesis_structural_wrap( 'site-tagline' ); printf( '<div %s>', genesis_attr( 'site-tagline-left' ) ); printf( '<h1 %s>%s</h1>', genesis_attr( 'entry-title' ), esc_html( get_the_title() ) ); echo '</div>'; printf( '<div %s>', genesis_attr( 'site-tagline-right' ) ); genesis_widget_area( 'site-tagline-right' ); echo '</div>'; genesis_structural_wrap( 'site-tagline', 'close' ); echo '</div>'; } }
September 5, 2013 at 12:34 pm #60901scotmMemberWorks great! Trying to add the same for categories and posts. Adding || is_single() works fine but || is_category() or || is_archive() displays the latest post in the category.
September 5, 2013 at 11:04 pm #61023KJAMemberscotm, did you get the categories working?
I'm looking to do the same thing and need to show the Category of a post entry in the tagline.
September 6, 2013 at 7:14 am #61055scotmMemberNot yet. Still working on this...
September 6, 2013 at 8:21 am #61068Digital PureMemberWould be a really cool feature add to put in the theme options a checkbox that stated: "show tagline or show page title"
September 7, 2013 at 4:02 pm #61266MarketLeanerMemberI'm sure there is a better way but after I removed all post titles with the remove_action, I just decided to selectively add genesiss_do_post_title back for specific (non-single) pages (like categories and tags) because I don't use them very often. So right now I only added my /blog and home page and I'll just add to it as needed. Would still be interested in seeing a better solution though. This is a bit budget.
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); add_action('get_header', 'selectively_remove_page_titles'); function selectively_remove_page_titles() { $pages = array( 21 ); if ( is_page($pages) ) { add_action( 'genesis_entry_header', 'genesis_do_post_title' ); } }
Shoutout to Brad's code http://wpsites.net/web-design/remove-titles-specific-conditions/
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.