[Support request] how to add h1 tag into my website

Home Forums Support [Support request] how to add h1 tag into my website

Home Forums Support how to add h1 tag into my website

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #642183
    Phat

    Hi,

    I want to add h1 into my website https://www.mavachshop.com

    could you help me?

    Thanks,
    Phat

    GP Premium 1.6.2
    #642237
    David
    Staff
    Customer Support

    Hi there,

    how have you constructed the home page? And where do you want to put the <h1> ?

    #642242
    Phat

    I want H1 is homepage title “Mã Vạch Shop”

    Could you help me?

    Thanks
    Phat

    #642244
    Phat

    I want H1 is Website Name “Mã Vạch Shop”

    #642473
    David
    Staff
    Customer Support

    Hi there,

    the Site Title should only be set as a H1 if there is no other H1 being used on the page. As you front page doesn’t have one you could add this PHP snippet:

    add_filter( 'generate_site_title_output','tu_frontpage_h1_title' );
    function tu_frontpage_h1_title() {
    	printf(
    		'<%1$s class="main-title" itemprop="headline">
    			<a href="%2$s" rel="home">
    				%3$s
    			</a>
    		</%1$s>',
    		( is_front_page() ) ? 'h1' : 'p',
    		esc_url( apply_filters( 'generate_site_title_href', home_url( '/' ) ) ),
    		get_bloginfo( 'name' )
    	);
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    For the other pages you could use a GP Page Header:

    https://docs.generatepress.com/article/page-header-overview/

    In particular you could add the title in the Page header content like so <h1>{{post_title}}</h1> that will pull in the title of the post automatically.

    #1242286
    Matias

    Hi, Im my homepage hasnt any h1 title.
    Im had check the option of hide page title and Im using a image.

    I had added that code using Code Snippet Pluging, but SEO Meta in 1 Click extension says that not h1 was found.

    any help?

    thank

    #1242595
    David
    Staff
    Customer Support

    Hi there,

    can you provide a link to your site ? With the above code added ?
    You may want to start your own topic so you can use the Site URL filed to share the link privately.

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