Home Forums Support h-Tags

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #125891
    Alexander

    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

    #125995
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #126022
    Alexander

    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?

    #126045
    Tom
    Lead Developer
    Lead Developer

    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

    #126092
    Alexander

    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?

    #126199
    Tom
    Lead Developer
    Lead Developer

    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.

    #126226
    Alexander

    Yes exactly, i want to do it all myself (for SEO).

    #126407
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #134948
    Alexander

    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

    #135022
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #135076
    Alexander

    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

    #135188
    Tom
    Lead Developer
    Lead Developer

    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

    #135197
    Alexander

    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.

    #135307
    Tom
    Lead Developer
    Lead Developer

    Interesting – what version of GeneratePress are you using?

    Can you link me to your site?

    #135339
    Alexander

    Tha latest, Version: 1.3.11

    Sorry, the Site is under Development with .htaccess Protection.

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