I have a posts category called events. On the archive page the iconfont is a pencil. I want to change that to \ue85b. Should I use CSS or functions.php? I tried both ways, but didn’t get it right either way.
I wasn’t sure how to do it in CSS.
In functions.php I tried the following code based on another post on the forum:
if(is_category('events')) {
add_filter('avf_default_icons','avia_replace_standard_icon', 10, 1);
function avia_replace_standard_icon($icons)
{
$icons['standard'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue85b');
return $icons;
}
}
But, it didn’t work. Any Advice?
Thank you!
I removed the if(is_category(‘events’)) wrapper and it worked. I don’t see a typo. Do you know why this might not be working when I add the if is statement?
Hi!
I think the if statement needs to go inside the function, not outside it.
Regards,
Rikard
Hi!
Do you have an “events” category? Try to replace the code with this:
add_filter('avf_default_icons','avia_replace_standard_icon', 10, 1);
function avia_replace_standard_icon($icons)
{
if(is_category('events')) {
$icons['standard'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue85b');
}
return $icons;
}
Regards,
Ismael