-
Author
-
June 20, 2015 at 15:56 #64033noboxcreativesParticipant
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.June 20, 2015 at 16:23 #64039sharmstrModeratorHmmm. 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 18:34 #64721sharmstrModeratorchange 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 18:41 #64722taigerParticipantHi i want to keep the title, and not to show the words “Archive for category”
June 24, 2015 at 18:54 #64723sharmstrModeratorYou 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 CODEfunction 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 19:07 #64725sharmstrModeratorWorks 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 solutionThis 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.June 24, 2015 at 22:01 #64753sharmstrModeratorNo. 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 22:19 #64762sharmstrModeratorThat 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 23:34 #64780sharmstrModeratorI 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
June 24, 2015 at 23:51 #64786sharmstrModeratorExcellent. 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.