Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Changing head's for frontpage only

Home / Forums / Virtue Theme / Changing head's for frontpage only

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
June 17, 2017 at 5:37 am

Normally the <title> is: “page title » website title”. Makes sense for all pages except for the website front page. For the frontpage it would be better if it was vice versa, that is: “website title » page title”. So this would make it “company name » description” (instead of “description » company name”) which is better for SEO and better for tabs in the browser (which list the title).

How could I change this using a child theme? I searched the forum and found two filters: ‘wp_title’ and ‘kadence_title’. So I am not sure which one to use. On the web I also saw notices that wp_title is deprecated but than reinstated ( So I am a bit puzzled. and what works best in Virtue Premium.

add_filter( 'wp_title', 'wpdocs_hack_wp_title_for_home', 10, 2 );

function wpdocs_hack_wp_title_for_home( $title, $sep ) {
if ( is_home() || is_front_page() ) {
$title = get_bloginfo( 'name', 'display' ) . $sep . get_bloginfo( 'description', 'display' );
}
return $title;
}

What’s the best (future safe) way of doing it?

  • The forum ‘Virtue Theme’ is closed to new topics and replies.