PHP to change Page Title to default to H1 instead of H1
-
My WordPress theme has the Page Titles defaulting to H2. The way my theme and WP Bakery Page Builder (fka Visual Builder or Composer)are set up leaves me with no way to change that. The result is that none of my pages have H1 tags. ??
I’m running a child theme and have a functions.php. The CSS Class for the page titles is “agni-slide-title”, if there’s a way I can override this with a CSS ID? I don’t think so though.
I searched through 20 PHP files and finally found a reference to h2 in a theme-functions.php file in another folder. Here’s the original reference:
// Filters of Agni Slider H tags add_filter( 'agni_page_header_h_tag', 'fortun_agni_slider_h_tag', 999 ); add_filter( 'agni_slider_h_tag', 'fortun_agni_slider_h_tag', 999 ); function fortun_agni_slider_h_tag($args){ return 'h2'; }
After hours of Googling, I took that line, changed to “h1”, changed the function name and put it in my functions.php.
Here’s what I added.add_filter( 'agni_page_header_h_tag', 'fortun_agni_slider_h_tag', 999 ); add_filter( 'agni_slider_h_tag', 'fortun_agni_slider_h_tag', 999 ); function my_title_tag(){ return 'h1'; }
Nothing changed though; all page titles are still h2.
I am PHP illiterate and relatively new to web design… sorry! Any help I can get would be SO appreciated!!The page I need help with: [log in to see the link]
- The topic ‘PHP to change Page Title to default to H1 instead of H1’ is closed to new replies.