-
AuthorPosts
-
February 14, 2015 at 1:15 pm #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?
February 15, 2015 at 5:33 pm #396413Hey 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!
ElliottFebruary 16, 2015 at 6:26 am #396529Thanks 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: etcso 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.
February 16, 2015 at 6:05 pm #396870Hi!
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ünterFebruary 17, 2015 at 3:20 am #397211Thanks 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!
-
AuthorPosts
- The topic ‘HELP – I edited the file avia_which_archive function and my site broke!’ is closed to new replies.