Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #396142

    I managed to reinstate the site by uploading the original file from the theme download but is it safe to edit this file?

    I would like to change the text displayed before Category Archive etc but worried this file might effect all current admin settings?

    #396413

    Hey pozza!

    I’m not really sure what you mean there but send us a link to your page and take a screenshot highlighting the exact area your wanting to customize and we’ll take a look.

    You can set your reply as private if you wish.

    Cheers!
    Elliott

    #396529

    Thanks Elliott,
    I have been trying to edit the file “function-set-avia-frontend.php” to remove the text:

    Archive of Category:
    Tag of Archive:
    Archive of Month: etc

    so the archive page titles just show the archive names – but when I do and then upload the edited file my site breaks (I’ve tried twice – same result – I had to reinstall original file to get site back).

    I found another option in the forums to remove the text from Category archive:

    https://kriesi.at/support/topic/category-archive-page-change-the-title/

    Can something like this be used to remove text in front of tag and date archive titles as well??

    Thanks again.

    #396870

    Hi!

    Thank you for coming back.

    I would advise to use this filter hook and not to modify the core file.

    You can use the hook as follow:

    
    add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3);
    function avf_change_which_archive($output)
    {
    
          // put here your code to modify $output;
    
                return $output;
    }
    

    $output is the string ready for output. If you want to remove parts of the string you can do it with a code similar to:

    
     $output = str_ireplace ( 'Archive for category:', '', $output);
    

    Or you can add parts of the core file to modify $output.

    Hope, this will help you.

    Do not forget at the end of the function:

    
         return $output;
    

    Cheers!
    Günter

    #397211

    Thanks Gunter,

    I have it working by adding this to my functions.php:

    add_filter(‘avf_which_archive_output’,’avf_change_which_archive’, 10, 3);
    function avf_change_which_archive($output)
    {
    if(is_category())
    {
    $output = single_cat_title(”,false);
    }
    elseif (is_tag())
    {
    $output = single_tag_title(”,false);
    }
    elseif (is_month())
    {
    $output = get_the_time( __(‘F, Y’,’avia_framework’) );
    }

    return $output;
    }

    Thanks for your assistance!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘HELP – I edited the file avia_which_archive function and my site broke!’ is closed to new replies.