Minimum Pro – Replace Site Tagline with Page Title

Community Forums Forums General Discussion Minimum Pro – Replace Site Tagline with Page Title

This topic is: not resolved

Tagged: 

This topic contains 12 replies, has 5 voices, and was last updated by  MarketLeaner 1 year, 3 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #59185

    Timothy Mayo
    Participant
    Post count: 5

    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!

    #59433

    Digital Pure
    Participant
    Post count: 4

    I 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.

    #59471

    Timothy Mayo
    Participant
    Post count: 5

    Ok 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.

    • This reply was modified 1 year, 3 months ago by  Timothy Mayo.
    • This reply was modified 1 year, 3 months ago by  Timothy Mayo.
    #59810

    scotm
    Participant
    Post count: 35

    Great idea, though it would be good to have the site-description retained on the home page.

    #59820

    Digital Pure
    Participant
    Post count: 4

    I 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' );
     } }
    
    #59892

    scotm
    Participant
    Post count: 35

    This 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.

    #59893

    scotm
    Participant
    Post count: 35

    No luck…white screened.

    #60498

    MarketLeaner
    Participant
    Post count: 27

    Second 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>';
    
    } }
    • This reply was modified 1 year, 3 months ago by  MarketLeaner.
    • This reply was modified 1 year, 3 months ago by  MarketLeaner.
    #60901

    scotm
    Participant
    Post count: 35

    Works 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.

    #61023

    KJA
    Participant
    Post count: 1

    scotm, 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.

    #61055

    scotm
    Participant
    Post count: 35

    Not yet. Still working on this…

    #61068

    Digital Pure
    Participant
    Post count: 4

    Would be a really cool feature add to put in the theme options a checkbox that stated: “show tagline or show page title”

    #61266

    MarketLeaner
    Participant
    Post count: 27

    I’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/

    • This reply was modified 1 year, 3 months ago by  MarketLeaner.
    • This reply was modified 1 year, 3 months ago by  MarketLeaner.
Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.