This topic has 6 replies, 2 voices, and was last updated 9 years by sharmstr.

  • Author
  • #94014
     bsolak
    Participant

    How can I eliminate Archive for category: Category name so that it would become Category name?

    Normally we entered clid theme some kind of code. & locate that address Hi, please see https://archived.seventhqueen.com/forums/topic/change-kleo-page-title-for-archives-and-other-wordpress-pages

    Will you please help me?

    #94067
     sharmstr
    Moderator

    Add the code in that link to your child theme’s functions.php file. Delete the text “Archive for category:” and whatever other text you dont want to show.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #94129
     bsolak
    Participant

    There are no code in that link. it’s deleted. Wish somebody enter the code.

    Thanks.

    #94130
     bsolak
    Participant
    This reply has been set as private.
    #94132
     sharmstr
    Moderator

    I see the code. See attached.

    In any case, here it is

    COPY CODE
    
    //Add me to child theme functions.php
    function kleo_title()
    {
    	$output = "";
     
    	if ( is_category() )
    	{
    		$output = __('Archive for category:','kleo_framework')." ".single_cat_title('',false);
    	}
    	elseif (is_day())
    	{
    		$output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
    	}
    	elseif (is_month())
    	{
    		$output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
    	}
    	elseif (is_year())
    	{
    		$output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
    	}
    	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:','kleo_framework')." ".esc_attr( get_search_query() );
    			}
    			else
    			{
    				$output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
    			}
    		}
    		else
    		{
    			if(!empty($_GET['s']))
    			{
    				$output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
    			}
    			else
    			{
    				$output = __('To search the site please enter a valid term','kleo_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','kleo_framework')." ";
     
    		if(isset($curauth->nickname)) $output .= __('for:','kleo_framework')." ".$curauth->nickname;
     
    	}
    	elseif (is_tag())
    	{
    		$output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
    	}
    	elseif(is_tax())
    	{
    		$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    		$output = __('Archive for:','kleo_framework')." ".$term->name;
     
    	} elseif ( is_front_page() && !is_home() ) {
    					$output = get_the_title(get_option('page_on_front'));
     
    	} elseif ( is_home() && !is_front_page() ) {
    					$output = get_the_title(get_option('page_for_posts'));
     
    	} elseif ( is_404() ) {
    					$output = __('Error 404 - Page not found','kleo_framework');
    	}
    	else {
    		$output = get_the_title();
    	}
     
    	if (isset($_GET['paged']) && !empty($_GET['paged']))
    	{
    		$output .= " (".__('Page','kleo_framework')." ".$_GET['paged'].")";
    	}
     
    	return $output;
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #94140
     bsolak
    Participant

    Thank you sharmstr. 🙂

    #94149
     sharmstr
    Moderator

    You’re welcome 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 7 posts - 1 through 7 (of 7 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?