Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
August 19, 2013 at 5:45 pm #28056
Hello,
I want to update the titles for the Archive pages. I found this post (https://kriesi.at/support/topic/archive-page-title-edit) where someone said to edit the function-set-avia-frontend.php file.
Editing the original file works, however I am using a child theme to override original files and not lose my changes. Creating a duplicate of the function-set-avia-frontend.php file (inside all the same folders) does not seem to override the original file.
Is it possible to override the function-set-avia-frontend.php file in a child theme at all, or no?
Thanks!
August 21, 2013 at 5:05 am #136295Hey,
You can copy the avia_which_archive function on the child theme’s function.php:
if(!function_exists('avia_which_archive'))
{
/**
* checks which archive we are viewing and returns the archive string
*/
function avia_which_archive()
{
$output = "";
if ( is_category() )
{
$output = __('ERERERERERER for category:','avia_framework')." ".single_cat_title('',false);
}
elseif (is_day())
{
$output = __('Archive for date:','avia_framework')." ".get_the_time('F jS, Y');
}
elseif (is_month())
{
$output = __('Archive for month:','avia_framework')." ".get_the_time('F, Y');
}
elseif (is_year())
{
$output = __('Archive for year:','avia_framework')." ".get_the_time('Y');
}
elseif (is_search())
{
global $wp_query;
if(!empty($wp_query->found_posts))
{
if($wp_query->found_posts > 1)
{
$output = $wp_query->found_posts ." ". __('search results for:','avia_framework')." ".esc_attr( get_search_query() );
}
else
{
$output = $wp_query->found_posts ." ". __('search result for:','avia_framework')." ".esc_attr( get_search_query() );
}
}
else
{
if(!empty($_GET['s']))
{
$output = __('Search results for:','avia_framework')." ".esc_attr( get_search_query() );
}
else
{
$output = __('To search the site please enter a valid term','avia_framework');
}
}
}
elseif (is_author())
{
$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
$output = __('Author Archive','avia_framework')." ";
if(isset($curauth->nickname)) $output .= __('for:','avia_framework')." ".$curauth->nickname;
}
elseif (is_tag())
{
$output = __('Tag Archive for:','avia_framework')." ".single_tag_title('',false);
}
elseif(is_tax())
{
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$output = __('Archive for:','avia_framework')." ".$term->name;
}
else
{
$output = __('Archives','avia_framework')." ";
}
if (isset($_GET['paged']) && !empty($_GET['paged']))
{
$output .= " (".__('Page','avia_framework')." ".$_GET['paged'].")";
}
return $output;
}
}Regards,
Ismael
August 22, 2013 at 5:55 pm #136296Thanks Ismael! That works great.
August 23, 2013 at 5:33 am #136297 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘Updating Archive title(s)’ is closed to new replies.