Archived topic
h-Tags
19 replies · Started by Alexander on August 3, 2015
Hi,
the Template uses H1-Tag for Article-Title, that is ok for me.
H2 is not uses by default for anything?
But H3 and H4 is used for "mobile-menu" Title and Widget Headline
But i want to use H2, H3, H4 in my Articles, how can i change this?
Alex
H2 is used for post titles on the blog.
H3 will no longer be used for mobile menu in 1.3.08, but is used for widget titles.
You can add headings inside your content at will by using the "Paragraph" option in the content editor.
Let me know if you need more info :)
My Version is 1.3.06 and there are no Updates?
H1 for Title is ok, but i want to use H2/H3/H4 for individual things, not fixed.
Is that possible?
1.3.08 isn't out yet (will be a couple weeks, 1.3.07 is up next).
You're free to use H2, H3 and H4 for whatever you like - you just need to use the editor to set them: https://en.support.wordpress.com/visual-editor/#styles
Yes, i know that :)
But then, i have multiple H2/H3/H4 Tags, those from the Theme (automatic) and those where i set. But i only want my, not those fixed from the Theme. Can I prevent that the Theme sets H-Tags (H2/H3/H4) automatically?
So you want to remove the blog post titles on the posts page (the only place GP sets H2 tags)?
And you want to remove the H3 tags from the widget title (only place GP sets H3 tags)?
If so, I may be able to come up with some code for you.
Yes exactly, i want to do it all myself (for SEO).
To remove H4 tags from the widget titles:
add_filter( 'generate_start_widget_title','generate_remove_widget_title_h4' );
function generate_remove_widget_title_h4()
{
return '<div class="widget-title">';
}
add_filter( 'generate_end_widget_title','generate_remove_widget_title_end_h4' );
function generate_remove_widget_title_end_h4()
{
return '</div>';
}
Removing the H2 from the blog post titles is much harder, this may or may not work: https://gist.github.com/generatepress/711900a4c068cea1af6b
If it doesn't work, you'll have to create a child theme and bring the content.php file from the generatepress folder into your child theme folder.
Then you can edit the tag directly in that child theme file.
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Hope this helps :)
Hi Tom,
is it possible to remove ALL the H-Tags from the Theme, so that I can put all of them self as I would like direct in the Content?
It would be nicest if i could do that in the Admin Panel :)
Alex
The post above shows how to remove them from the widget titles and blog posts: https://generatepress.com/forums/topic/h-tags/#post-126407
Here's how you can remove them from pages: https://generatepress.com/forums/topic/remove-title-from-being-visible-as-heading/#post-134787
If you do the above it will remove all heading tags from the theme :)
Hi Tom,
thnaks for the Info. I testes with Child-Theme, H4 works, H1 unfortunately not.
I understand that it makes sense to put the Tags by default, especially for Beginners.
But just as it would be useful, if i could turn off the Tags in the Admin completely, or could assign which Headline gets what Tag. Perhaps for the future? -:)
Alex
It's not a very common thing for people to want to do this, so I don't know if an option for it is really necessary - I try super hard to only add completely necessary options to prevent clutter.
That H1 code should absolutely work - tested it a few times and multiple users have had success with it.
When you add this code, the page titles don't disappear?: https://generatepress.com/forums/topic/remove-title-from-being-visible-as-heading/#post-134787
Hi,
i use a the Blank Child-Theme from GP. I copied the Filters in the functions.php:
<?php
/**
* Generate child theme functions and definitions
*
* @package Generate
*/
add_filter( 'generate_start_widget_title','generate_remove_widget_title_h4' );
function generate_remove_widget_title_h4()
{
return '<div class="widget-title">';
}
add_filter( 'generate_end_widget_title','generate_remove_widget_title_end_h4' );
function generate_remove_widget_title_end_h4()
{
return '</div>';
}
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() && 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;
}
But the Title (H1) don't go away.
Interesting - what version of GeneratePress are you using?
Can you link me to your site?
Tha latest, Version: 1.3.11
Sorry, the Site is under Development with .htaccess Protection.