Category title

Latest Reply from dudarev93 at 2016-02-26 03:17:13 Solution
Good day. I have next problem.

On category page in title shows name of last material. I want display category name in title. A screenshot to the detailed display problems.

[url=http://itmages.ru/image/view/3887277/97e8dc2c][img]http://storage7.static.itmages.ru/i/16/0216/s_1455610507_1848939_97e8dc2c3e.png[/img][/url]
Hi!

Thank you for letting us know about this issue. We will fix this issue soon. For a quick fix for your website, please replace the code:
function smt_wp_title( $title, $sep ) {
global $SMTheme;
if (is_front_page()) {
$title=($SMTheme->get( 'general','sitename' ))?$SMTheme->get( 'general','sitename' ):get_bloginfo('name');
$format="%s";
} else {
$title=get_the_title();
$format=($SMTheme->get( 'general','sitenamereg' ))?$SMTheme->get( 'general','sitenamereg' ):"%s - ".get_bloginfo('name');
}
$SMTheme->pagetitle=sprintf($format,$title);
return sprintf($format,$title);
}

with:
function smt_wp_title( $title, $sep ) {
global $SMTheme;
if (is_front_page()) {
$title=($SMTheme->get( 'general','sitename' ))?$SMTheme->get( 'general','sitename' ):get_bloginfo('name');
$format="%s";
} else {
$title=is_category()?single_cat_title():get_the_title();
$format=($SMTheme->get( 'general','sitenamereg' ))?$SMTheme->get( 'general','sitenamereg' ):"%s - ".get_bloginfo('name');
}
$SMTheme->pagetitle=sprintf($format,$title);
return sprintf($format,$title);
}
inside the functions.php file of the theme.
Thank you. I noticed the same problem on the tag page. Please help.
Use the following function instead of the current one:
function smt_wp_title( $title, $sep ) {
global $SMTheme;
if (is_front_page()) {
$title=($SMTheme->get( 'general','sitename' ))?$SMTheme->get( 'general','sitename' ):get_bloginfo('name');
$format="%s";
} elseif (is_category()) {
$title=single_cat_title();
$format="%s";
} elseif (is_archive()) {
$title=get_the_archive_title();
$format="%s";
}elseif (is_tag()) {
$title=single_tag_title();
$format="%s";
} else {
$title=get_the_title();
$format=($SMTheme->get( 'general','sitenamereg' ))?$SMTheme->get( 'general','sitenamereg' ):"%s - ".get_bloginfo('name');
}
$SMTheme->pagetitle=sprintf($format,$title);
return sprintf($format,$title);
}
Thanks. It's work.

Leave a reply

Add codeAdd image