Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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.

    #203369

    Hi 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!
    Yigit

    #204303

    I 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!
    John

    #204355

    Hey!

    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,
    Ismael

    #205026

    Thanks Ismael!

    That did the trick perfectly!!

    – John

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Hide Archive for Category in Page Header — Child Theme Follow Up’ is closed to new replies.