Hi,
thank you for your advice. I have modified a/m function and put it into my child theme functions.php:
/****************************** Override Theme Term Page Title text and icon ******************************/
/* Term Page title
/* @todo => generalize to all taxinomies, including custom ones
/* ------------------------------------ */
if ( ! function_exists( 'hu_get_term_page_title' ) ) {
function hu_get_term_page_title() {
if ( is_category() ) {
$title = sprintf('<i class="fa fa-folder-open"></i>%1$s <span>%2$s </span>',
__('Category:','hueman'),
single_cat_title('', false)
);
}
else if ( is_tag() ) {
$title = sprintf('<i class="fa fa-map"></i>%1$s <span>%2$s </span>',
__('Oblast:','hueman'),
single_tag_title('', false)
);
}
if ( is_tax() ) {
$title = sprintf('<i class="fa fa-map-marker"></i>%1$s <span>%2$s </span>',
__('Místo:','hueman'),
single_term_title('', false)
);
}
return $title;
}
}
But I have no succcess, you can see it here: https://telezjetele.cz/misto/smrcina/
Both is_tax() and single_term_title() seem to work – the same code at the same page works as you can see in the sidebar on the top (“Místo: Smr?ina”). I put this code into PHP enabled text widget:
if ( is_tax() ) {
$title = sprintf('<i class="fa fa-map-marker"></i>%1$s <span>%2$s </span>',
__('Místo:','hueman'),
single_term_title('', false)
);
echo $title
}
What am I doing wrong? I am not a professional PHP coder…
-
This reply was modified 8 years, 4 months ago by
manasek.