Site logo

Archived topic

Post title both in header and in single article

7 replies · Started by ch1800 on December 5, 2021

Viewing posts 1–8 of 8

Hello,

I'm usually placing blog article titles in headers but for one particular case I would like to have it both in the header and on top of a single article, as is the case with Java site here - but without using blocks, please!

If I'm not wrong, the placement on top of a single article is the default position in WP but it gets nulled when using a header element that includes the title.

Thanks.

Hi there,

If I’m not wrong, the placement on top of a single article is the default position in WP but it gets nulled when using a header element that includes the title.

This is correct but Java(the latest edition) uses a Block element to add the Header title in. The new Java actually displays the title on both the Header(Block Element) and default(theme's title element) as shown here - https://share.getcloudapp.com/9ZuRkEmd

Can you link us to a sample post in question? To get a clearer idea of what your site currently has and check what we can do about it.

You can use the private information text field to provide site details. Thanks! :)

Thanks Elvin,

This is correct but Java(the latest edition) uses a Block element to add the Header title in. The new Java actually displays the title on both the Header(Block Element) and default(theme’s title element) as shown here

That's right and the screenshot I've sent you before shows exactly the same and what is needed.

I'm working on redesigning an existing site, so the link I'm adding here is really temporary but has already the needed header elements enabled.

Can you provide the password as well? The post linked is password protected. Thanks.

While waiting:

I'm not sure if this is applicable w/o checking the site but you can actually try enabling the title removed by the Header element by adding this PHP snippet:

add_filter( 'generate_show_title', function($display){
if(is_single(123)){
return true;
}
return $display;
},99,1);

Change 123 to the ID of this post so the default title element of the theme displays on this post. :D

Oops, sorry about, that I forgot!
Added it here.

I didn't yet test the snippet you provided as this would not be for a particular post but for all of them - if possible.

If it's for all the single post pages, you can try this:

add_filter( 'generate_show_title', function($display){
if(is_single()){
return true;
}
return $display;
},99,1);

Wonderful!
Many thanks Elvin.

No problem. :D

This archived topic is closed to new replies.