[Resolved] Can’t change BLOG Title

Home Forums Support Can’t change BLOG Title

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1455342
    Nic

    For some reason the Title “BLOG” on blog homepage can not be changed – what do i miss here?? normally it gets generated by the page title. but seems an exception here:

    View post on imgur.com

    screenshot shows split view. left side frontend and right side backend. Where do i change “BLOG”??

    Site Infos in hidden field.

    #1455356
    David
    Staff
    Customer Support

    Hi there,

    are you using a Header Element to display the {{post_title}} ?
    If so that won’t work on the Blog page – you will need to create a separate Header Element and add your title within the element.

    Make sure you exclude the Blog from your other Header Element.

    #1456451
    Nic

    yes indeed i use the delivered header element with <h1>{{post_title}}</h1>. still confuses me where “blog” comes from. DB entry contains “News” for this page id. Do you insert it by code?

    #1456620
    David
    Staff
    Customer Support

    “Blog” comes from the Hero element function.
    As the WP blog does not have a ‘content title’ and does not parse any Meta box values we had two choices:

    1. Don’t output anything – which could lead the Element not displaying at all.
    2. Auto add a commonly used title.

    Either choice required the above steps to fix. The latter was less confusing to users and easier for us to diagnose and assist with a fix.

    #1456648
    Nic

    sorry but i don’t agree. you can always get the title from the blog page by
    get_the_title(get_option('page_for_posts'))
    even outside the loop! just use the value if it is not empty.

    #1457273
    Tom
    Lead Developer
    Lead Developer

    You can do something like this:

    add_filter( 'generate_page_hero_post_title', function( $title ) {
        if ( is_home() ) {
            $title = 'Your custom title';
        }
    
        return $title;
    } );
    #1458212
    Nic

    alright this works for me:

    add_filter( 'generate_page_hero_post_title', function( $title ) {
    	if ( is_home() OR is_singular("post") ) {
    		$title = get_the_title(get_option('page_for_posts'));
    	}
    
    	return $title;
    } );

    thanks for the hook!
    another question regarding global header element: seems, if i put {{post_title}} in it, the default title of the current post disappears. if there is no {{post_title}} in the header element, the post title is appears again. how and where is this controlled? i need to exclude it for posts.

    #1458249
    Nic

    alright, this seems to do the trick:

    add_filter("generate_show_title",function(){
        if(is_singular("post")) return true;
        return false;
    },100);
    #1458819
    Tom
    Lead Developer
    Lead Developer

    Yea, we use that same filter to disable the main title if {{post_title}} is found. Glad you got it all working 🙂

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.