This topic has 5 replies, 2 voices, and was last updated 8 years by sharmstr.

  • Author
  • #72054
     ShauntiG
    Participant

    Ok, since I haven’t received a reply on this issue due to possible Q&A redundancy, I’ll explain in more detail my experience with the annoying WP “Archive for category” text. I wanted to just remove this text only. Not the whole thing. As in if you have a Category named “Apples” the whole thing would read “Archive for category: Apples”, which is not what is needed for a menu item. What is needed is just “Apples”. The code $output = __(‘Archive for category:’,’kleo_framework’).” “.single_cat_title(”,false); in Kleo child theme/functions.php has not worked. I’ve tried removing the “Archive for category:” text and the whole thing is still there. I cleared the cache and it’s still there. The only thing that has worked so far is only a partial fix, which is in Custom CSS .archive .page-title { display: none; } which removes the whole thing, and that’s not quite what I want. What is the Custom CSS to just remove “Archive for category:” and not “Apples”? I’m running the latest version of WP, could that be the issue for the first above mentioned code not to work? Because from my end it’s clearly Apples & Oranges…Parton the pun… Someone please help. https://socialbilitty.com

    #72060
     sharmstr
    Moderator

    If you merely want to remove it from the page title: https://archived.seventhqueen.com/forums/topic/hide-archive-for-category-in-the-title#post-64723 Though make sure you get the latest kleo_title function code from /kleo/kleo-framework/lib/function-core.php since I dont know if its been changed since I’ve posted that.

    You mentioned menus, but I dont see where that is happening on your site.

    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

    #72315
     ShauntiG
    Participant

    Thanks for responding, I don’t want to remove the entire page title, right now the page title is completely removed with .archive .page-title { display: none; } in quick CSS, the URL https://socialbilitty.com/category/news/entertainment/filmmaking/ for example is a menu item on the front page of the site. I want the title to read just “Filmmaking”, it is also an H1 tag for SEO as well. The latest kleo_title function code was last modified on 11-20-14, if I need to update the code where can I get the latest, the Kleo theme Version: 3.0.6. is in the latest, which is installed.

    Thanks,

    #72322
     sharmstr
    Moderator

    I wasnt suggesting using css at all. I understand you dont want to remove the entire title, that’s why gave you that link and not the css. Please read my answer again. I gave you the path to the latest code.

    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

    #72346
     ShauntiG
    Participant
    This reply has been set as private.
    #72439
     sharmstr
    Moderator

    You need the entire kleo_title function.

    COPY CODE
    
    function kleo_title()
    	{
    		$output = "";
            if (is_tag()) {
                $output = single_tag_title('',false);
            }
    		elseif(is_tax()) {
                $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
                $output = $term->name;
            }
    		elseif ( is_category() ) {
                $output = 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_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_archive() )  {
    			$output = post_type_archive_title( '', false );
    		}
    		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_front_page() && !is_home() ) {
                $output = get_the_title(get_option('page_on_front'));
                
    		} elseif ( is_home() ) {
                if (get_option('page_for_posts')) {
                    $output = get_the_title(get_option('page_for_posts'));
                } else {
                    $output = __( 'Blog', 'kleo_framework' );
                }
                
    		} 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

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

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?