HI, I would like to change the Titles for the h1.main-title-entry-title for our Portfolio categories so the title is Our Work: {category name} instead of Archive of: {category name}
I saw a reply to a similar post and tried the following code in my functions.php file, but it doesn’t work. Am I headed in the right direction? Can you give me some advice? Thanks!!
add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3);
function avf_change_which_archive($output)
{
if(is_tax())
{
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
if(is_tax('portfolio_category')){
$output = __('Our Work:','avia_framework')." ".$term->name; } else {
$output = __('Archive for:','avia_framework')." ".$term->name; }
}
return $output;
}
Hey kallym,
Thank you for using Enfold.
Yes, that’s the correct filter but you have to adjust it a bit.
add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3);
function avf_change_which_archive($output)
{
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
if(is_tax('portfolio_entries')){
$output = __('Our Work:','avia_framework')." ".$term->name;
} else {
$output = __('Archive for:','avia_framework')." ".$term->name;
}
return $output;
}
Best regards,
Ismael
That worked. Thanks!!
Hi,
Great, glad you got it working :-)
Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
Rikard
Thank you! It’s resolved.