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

Issue with Polylang plugin

Home / Forums / Virtue Theme / Issue with Polylang plugin

This topic is: Not Resolved
[Not Resolved]
Posted in: Virtue Theme
January 4, 2017 at 5:16 pm

Hello,
I found this issue on my blog with Polylang plugin. On the archives pages it doesn’t show correct titles, but the name of the current language. You can see this on this page:

I know that the problem is in utils.php file in function title. When I change this code to:
function kadence_title() {
if (is_home()) {
if (get_option('page_for_posts', true)) {
$title = get_the_title(get_option('page_for_posts', true));
} else {
$title = __('Latest Posts', 'virtue');
}
} elseif (is_archive()) {
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
if ($term && $term->name != 'Polski' && $term->name != 'English') {
return $term->name;
} elseif (is_post_type_archive()) {
$title = get_queried_object()->labels->name;
} elseif (is_day()) {
$title = sprintf(__('Daily Archives: %s', 'virtue'), get_the_date());
} elseif (is_month()) {
$title = sprintf(__('Monthly Archives: %s', 'virtue'), get_the_date('F Y'));
} elseif (is_year()) {
$title = sprintf(__('Yearly Archives: %s', 'virtue'), get_the_date('Y'));
} elseif (is_author()) {
$title = sprintf(__('Author Archives: %s', 'virtue'), get_the_author());
} else {
$title = single_cat_title("", false);
}
} elseif (is_search()) {
$title = sprintf(__('Search Results for %s', 'virtue'), get_search_query());
} elseif (is_404()) {
$title = __('Not Found', 'virtue');
} else {
$title = get_the_title();
}
return apply_filters('kadence_title', $title);
}

it works correctly. Can you fix this and keep on all updates? As you can see I added one line:
if ($term && $term->name != 'Polski' && $term->name != 'English') {
return $term->name;

Thanks,
Winc

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