This topic has 18 replies, 3 voices, and was last updated 9 years by taiger.

  • Author
  • #64033
     noboxcreatives
    Participant

    Hi team,

    I’ve created a page to show only a certain category of the posts on the page. As a title it shows “Archive category for Blog” (I wanted to show only specific posts on the page). Could you please help set a custom title or hide the title portion shown on a page? Because it’s not a page, I can’t turn it off as I would’ve done it in the page settings. I assume a custom CSS needs to be added. Please assist in this matter.

    I’ve attached the image to showcase it.

    Attachments:
    You must be logged in to view attached files.
    #64039
     sharmstr
    Moderator

    Hmmm. You can try this, but it will hide the title for all archive pages.

    COPY CODE
    
    .archive .container-wrap.main-title {
      display: none;
    }
    
    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

    #64109
     noboxcreatives
    Participant

    Thank you! I’ll try this.

    #64720
     taiger
    Participant
    This reply has been set as private.
    #64721
     sharmstr
    Moderator

    change it to
    .archive .page-title {
    display: none;
    }

    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

    #64722
     taiger
    Participant

    Hi i want to keep the title, and not to show the words “Archive for category”

    #64723
     sharmstr
    Moderator

    You can either translate it by replacing it with ” or you can copy the kleo_title function to your childs functions.php file and edit as necessary. Sorry for not understanding the first two times 🙂

    COPY CODE
    
    function kleo_title()
    	{
    		$output = "";
            if (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 = $term->name;
            }
    		elseif ( is_category() ) {
                //$output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
                $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;
    	}
    

    In the code above, I commented out the archive for category and added just the category name.

    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

    #64724
     taiger
    Participant
    This reply has been set as private.
    #64725
     sharmstr
    Moderator

    Works for me. Perhaps clear your cache? Also, its functions.php not function.php

    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.
    #64734
     taiger
    Participant

    Works for me now.. Thanks

    #64752
     taiger
    Participant
    This reply has been set as private.
    #64753
     sharmstr
    Moderator

    No. That’s how you do it. You probably made a mistake when you copied/pasted it.

    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

    #64754
     taiger
    Participant
    This reply has been set as private.
    #64762
     sharmstr
    Moderator

    That makes no sense. The function already runs, you’re just adding a new copy of it. Standard WP stuff. If you think its a plugin conflict, then figure out which one. Also, again, you keep saying function.php but the file should be functions.php. Specifically /themes/kleo-child/functions.php

    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

    #64777
     taiger
    Participant
    This reply has been set as private.
    #64780
     sharmstr
    Moderator

    I dont understand? If you are referring to my “makes no sense” comment, that wasnt intended to be a put down. I was merely stating a fact. It makes no sense because that function runs by default. So if it is a plugin conflict it would be happening even when you dont have it in your child theme. Does that clear things up a bit?

    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

    #64783
     taiger
    Participant
    This reply has been set as private.
    #64786
     sharmstr
    Moderator

    Excellent. If you can find a plugin conflict, I’d like to know. Thank you.

    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

    #64793
     taiger
    Participant
    This reply has been set as private.
Viewing 19 posts - 1 through 19 (of 19 total)

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

Log in with your credentials

Forgot your details?