Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1064870

    Hi,
    I constantly use this forum to get answers for customisation I want to do to a site. I found some code to paste to the bottom of the functions.php that took off the “Archive for Category” and all the other variations. I have just updated by site to the latest version of Enfold and it obviously replaced the functions.php that I had modified so I went in and repasted it from a saved version but it still doesn’t work. I thought it might be cached so I went to another browser that I rarely use to check it and no it’s still there…..grrrrrrrrrr. This is the code I am using (see below) what am I doing wrong? and How do I get rid of those words please.

    function avia_which_archive()
    {
    $output = “”;

    if ( is_category() )
    {
    $output = __(‘Archive for category:’,’avia_framework’).” “.single_cat_title(”,false);
    }
    elseif (is_day())
    {
    $output = __(‘Archive for date:’,’avia_framework’).” “.get_the_time( __(‘F jS, Y’,’avia_framework’) );
    }
    elseif (is_month())
    {
    $output = __(‘Archive for month:’,’avia_framework’).” “.get_the_time( __(‘F, Y’,’avia_framework’) );
    }
    elseif (is_year())
    {
    $output = __(‘Archive for year:’,’avia_framework’).” “.get_the_time( __(‘Y’,’avia_framework’) );
    }
    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) && isset($curauth->ID))
    {
    $name = apply_filters(‘avf_author_nickname’, $curauth->nickname, $curauth->ID);
    $output .= __(‘for:’,’avia_framework’) .” “. $name;
    }

    }
    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’].”)”;
    }

    $output = apply_filters(‘avf_which_archive_output’, $output);

    return $output;
    }

    #1065603

    Hey onclickdesign,

    Best regards,
    Victoria

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.