• prayvideos

    (@prayvideos)


    Hello wordpress team!
    Kindly, tell me the procedure of how to replace the product or post entry title which is h2, how can i replace it with h1?

    • This topic was modified 5 years ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not a Installing WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • Tyler

    (@tylerthedude)

    Hi there,

    You should be able to change specifically from the <h2> tag to the <h1> tag from editing the page using the Gutenberg Editor. There should be a block that will allow you to specifically edit the heading tags from the code block or the heading block.

    Thanks!
    Tyler

    Hi @prayvideos ,

    If your theme doesn’t provide an option setting for this, you can use the the_title filter hook. Try adding this to your child theme functions.php file.

    Sample Usage

    
    function change_title_h2_h1( $title, $id = null ) {
    
        return '<h1>'.$title.'</h1>';
    }
    add_filter( 'the_title', 'change_title_h2_h1', 10, 2 );
    
    

    Codex

    https://codex.www.ads-software.com/Plugin_API/Filter_Reference/the_title

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to replace default h2 entry title with h1’ is closed to new replies.