Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #995787

    HI, I would like to change the Titles for the h1.main-title-entry-title for our Portfolio categories so the title is Our Work: {category name} instead of Archive of: {category name}

    I saw a reply to a similar post and tried the following code in my functions.php file, but it doesn’t work. Am I headed in the right direction? Can you give me some advice? Thanks!!

    add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3);
    function avf_change_which_archive($output)
    {
    	if(is_tax())
    	{
    		$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    			if(is_tax('portfolio_category')){
    				$output = __('Our Work:','avia_framework')." ".$term->name; } else {
    			
    			$output = __('Archive for:','avia_framework')." ".$term->name; }
    	}
    
    	return $output;
    }
    • This topic was modified 6 years, 3 months ago by kallym. Reason: clarify that it't for Portfolio Categories
    #996036

    Hey kallym,

    Thank you for using Enfold.

    Yes, that’s the correct filter but you have to adjust it a bit.

    add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3);
    function avf_change_which_archive($output)
    {
        $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
        if(is_tax('portfolio_entries')){
            $output = __('Our Work:','avia_framework')." ".$term->name; 
        } else {
            $output = __('Archive for:','avia_framework')." ".$term->name; 
        }
    
    	return $output;
    }

    Best regards,
    Ismael

    #996161

    That worked. Thanks!!

    #996240

    Hi,

    Great, glad you got it working :-)

    Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #996367

    Thank you! It’s resolved.

    #996379

    Hi,
    Glad Ismael could help, we will close this now. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Change "Archive For: " text on Portfolio Category Main Title’ is closed to new replies.