BuddyDev

Search

How can I change all my page titles back to H1?

Tagged: ,

  • Participant
    Level: Initiated
    Posts: 4
    bbuser44 on #51147

    The titles were originally H1, but then strangely they switched to H2. Is there something I can do, like a code snippet I can add, to override that change and set the titles as H1?

    The site is vwat.org.

  • Keymaster
    (BuddyDev Team)
    Posts: 24238
    Brajesh Singh on #51155

    Hi,
    I am sorry, we need more context info.

    Which titles are you referring to? Are you using a custom theme or the default one? Is it happening on WordPress posts/pages or BuddyPress?

    Please share more details to help us assist you better.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 4
    bbuser44 on #51157

    All the page titles including the blog post pages. When I click on “Inspect Element,” it shows all the titles are wrapped in H2s, not H1s.

    And I’m using a custom theme, Loveicon, which you can find on ThemeForest. But I’m not sure it’s the theme.

  • Participant
    Level: Initiated
    Posts: 4
    bbuser44 on #51165

    Actually, I just got this php snippet below, and it does change the page titles, but unfortunately, it also changes the menu items too as you can see in this screenshot: https://workdrive.zohoexternal.com/file/7p7yf3b5bbccb90114c8ab9c0892480461609.

    Any ideas about how to edit it so the menu items aren’t changed?

    —-

    function change_page_titles_to_h1($title) {

    // Check if it’s a single page or post

    if (is_single() || is_page()) {

    $title = ‘<h1>’ . $title . ‘</h1>’;

    }

    return $title;

    }

    add_filter(‘the_title’, ‘change_page_titles_to_h1’);

  • Keymaster
    (BuddyDev Team)
    Posts: 24238
    Brajesh Singh on #51183

    This is a bad idea.
    My suggestion is to find what is causing the issue. It is not caused by BuddyPress.

    If you are able to locate the source of issue, you can reach out to the developers for a proper solution.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved