
-
AuthorPosts
-
October 30, 2015 at 10:29 am #527277
Hey there,
i want to make the following change:
https://kriesi.at/support/topic/changing-text-on-archivetag-pages/But i want to change this in the child theme and not in the default enfold theme.
Where do i have to save the edited .php file in the child-theme folder?
Do i have to make additional changes to another file?Thanks a lot for your help!
Best regards
ChrisOctober 30, 2015 at 11:05 pm #527749Hi Chris!
Since it is wrapped in the “function_exists” line you can copy the whole function to your child theme functions.php file and it will be used instead.
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 = __('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; } }
Best regards,
ElliottOctober 31, 2015 at 2:00 pm #527904Hy Elliot,
thank you very much for that!
i will test it this weekend and give you a feedback here.Best regards
ChrisNovember 2, 2015 at 7:18 pm #528756alright, let us know how it goes. We will let this thread open for you.
Cheers!
AndyDecember 23, 2015 at 3:40 pm #556997Hi Andy,
sorry for the late reply.
It worked that way, thank you very much!Best regards
Chris -
AuthorPosts
- The topic ‘Child Theme – Changes on a .php-file in another folder’ is closed to new replies.