-
Homepage Title “page not found” issue with https://www.elegantthemes.com/gallery/extra/ themes. When I deactivate the Rank Math Seo plugin, the problem was fixed.
I fixed the problem by using the below code:
/** * Only load if Rank Math plugin is activated */ if ( defined('RANK_MATH_FILE' ) && 'layout' === get_option('show_on_front') ) { /** * Adjusting homepageās title tag * @return string */ function extra_rank_math_homepage_title_adjustment( $title ) { if ( is_home() ) { $title = RankMath\Helper::replace_vars( RankMath\Helper::get_settings('titles.homepage_title') ); } return $title; } add_filter('rank_math/frontend/title', 'extra_rank_math_homepage_title_adjustment', 16 ); /** * Adjusting homepageās meta description * @return string */ add_filter( 'rank_math/frontend/description', function( $description ) { if ( is_home() ) { $description = RankMath\Helper::replace_vars( RankMath\Helper::get_settings( 'titles.homepage_description' ) ); } return $description; }); /** * Adjusting homepageās robots * @return string */ add_filter( 'rank_math/frontend/robots', function( $robots ) { if ( is_home() ) { $robots = RankMath\Helper::get_settings( 'titles.homepage_robots' ); if ( ! is_array( $robots ) || ! in_array( 'noindex', $robots ) ) { $robots['index'] = 'index'; } if ( ! is_array( $robots ) || ! in_array('nofollow', $robots ) ) { $robots['follow'] = 'follow'; } } return $robots; }); }
But I have many sites running on the extra theme and I want wanna add these code manually. there will be an update regarding this problem in the future?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The ticket ‘Homepage Title "page not found" issue’ is closed to new replies.