-
AuthorPosts
-
December 23, 2013 at 10:27 pm #203367
I found the solution to removing the “archive for category” text in the header in this thread.
I’m new to this theme and haven’t updated it before, but will this edit be undone each time I update? Is this a file we should copy over to the child theme?
Thanks.
December 23, 2013 at 10:34 pm #203369Hi tck!
Yes, you are going to need to repeat it each time you update your theme. But you can use child theme to avoid it. Please see video tutorial that Devin prepared on creating a child theme here http://vimeo.com/channels/aviathemes/67221517
Cheers!
YigitJanuary 1, 2014 at 8:47 pm #204303I am looking to do the same thing. I have a child theme setup, but still haven’t gotten my head around using hooks & filters to change things.
Would I add something to the functions.php file that I put in my child-theme or would I copy over the function-set-avia-frontend.php and edit it?
Thanks!
JohnJanuary 2, 2014 at 3:04 am #204355Hey!
You can copy the whole avia_which_archive function on the child theme’s functions.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 = __('Awesome 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)) $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; } }
Best regards,
IsmaelJanuary 3, 2014 at 4:32 pm #205026Thanks Ismael!
That did the trick perfectly!!
– John
-
AuthorPosts
- The topic ‘Hide Archive for Category in Page Header — Child Theme Follow Up’ is closed to new replies.