Hi there,
with a php snippet im able to change the title “Blog – Latest News” or a german page “Blog – Die aktuellsten Neuigkeiten”.
but how is the code-snippet for german and english on a multiligual site?
Hey volmering!
Try editing line 9 in the single.php file instead.
$title = __('Blog - Latest News', 'avia_framework'); //default blog title
And then use this plugin, https://wordpress.org/plugins/codestyling-localization/, and re-scan the theme texts and find that text to translate.
Regards,
Elliott
hi elliot, thx for your answer.
i would prefer following snippet in the functions.php. but for both languages. this one is for german:
add_filter(‘avf_title_args’, ‘fix_single_post_title’, 10, 2);
function fix_single_post_title($args,$id)
{
if ( $args[‘title’] == ‘Blog – Die aktuellsten Neuigkeiten’ )
{
$args[‘title’] = get_the_title($id);
$args[‘link’] = get_permalink($id);
$args[‘heading’] = ‘h1’;
}
return $args;
}
because:
1. codestyling localization has some probs with wp 4.0.1
2. i would like the title = title of the news
Hi!
Try this out.
add_filter(‘avf_title_args’, ‘fix_single_post_title’, 10, 2);
function fix_single_post_title($args,$id)
{
if ( ICL_LANGUAGE_CODE == 'de' )
{
$args['title'] = "Blog – Die aktuellsten Neuigkeiten";
$args['link'] = get_permalink($id);
$args['heading'] = ‘h1′;
}
if ( ICL_LANGUAGE_CODE == 'en' )
{
$args['title'] = "Blog - Latest News";
$args['link'] = get_permalink($id);
$args['heading'] = ‘h1′;
}
return $args;
}
Regards,
Elliott
perfect !!!!!!!!!!! thx alot