Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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!

    #136295

    Hey,

    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

    #136296

    Thanks Ismael! That works great.

    #136297

    Hey,

    Glad we could help. :)

    Cheers,

    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Updating Archive title(s)’ is closed to new replies.