BuddyDev

Search

Replies

  • 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’);

  • 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 #51092

    It did, thank you so much! Really awesome how you provide free and quick assistance, so appreciated

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

    I did try this code snippet from another thread I read here, but it didn’t work.

    https://workdrive.zohoexternal.com/file/3d6abcc4b030a83b049a0bb440e67b8611154