- This topic has 6 replies, 3 voices, and was last updated 8 years, 5 months ago by Mahesh.
-
AuthorPosts
-
April 18, 2016 at 12:22 am #89773a2h2Participant
Hi,
I love the theme but when I create a new category menu item, the title of that particular page is Category: ‘name of category’.
I would like to remove the Category: part but do not know what I need to do to get that particular tag removed from my page.
Any help is welcome.
April 18, 2016 at 11:37 am #89798MaheshParticipant@a2h2: You’ll need to create a child theme for this. You can find more on creating child theme HERE. Then in your child theme’s functions.php add the following codes.
add_filter( 'get_the_archive_title', function ($title) { if ( is_category() ) { $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $title = single_tag_title( '', false ); } elseif ( is_author() ) { $title = '<span class="vcard">' . get_the_author() . '</span>' ; } return $title; });
Regards,
MaheshApril 28, 2016 at 9:53 pm #90637pennythepennstategnomeParticipantWhat if you want to change the text in the box? I don’t mind the text box, but I would like to edit what it says… not “Category: ‘name of category’”.
Thanks!
April 28, 2016 at 9:53 pm #90638pennythepennstategnomeParticipantWhat if you want to change the text in the box? I don’t mind the text box, but I would like to edit what it says… not “Category: ‘name of category’”.
Thanks!
April 29, 2016 at 9:57 am #90663MaheshParticipant@pennythepennstatgnome: Can you please clarify more with a screenshot and your site url.
Regards,
MaheshApril 29, 2016 at 7:19 pm #90696pennythepennstategnomeParticipanthttp://www.pennythepennstategnome.com/
When you click one of my categories such as North America or Europe, there is a box that states “Category Archives: North America” or “Category Archives: Europe” :
http://www.pennythepennstategnome.com/category/north-america/I would like to edit that text. Can I do that?
I want to be able to have all my posts listed in this box, so if there is one a reader wants to view, they can click and get to it, instead of scrolling thru all the posts.(i dont know how to send a screen shot thru this)
May 3, 2016 at 9:52 am #90892MaheshParticipant@pennythepennstategnome: You are using Adventurous Theme. In adventurous theme, the above code won’t work, it is for Studio Theme.
For Adventurous theme, create child theme and then copyarchive.php
from Adventurous theme to you child theme folder. Then editarchive.php
file, go to line 23 and change the text Category Archives to your desired text and save it.
For listing all posts in the box without pagination, add the following codes inarchive.php
just above<?php if ( have_posts() ) : ?>
line.<?php global $wp_query; query_posts( array_merge( $wp_query->query, array('posts_per_page' => -1) ) ); ?>
Regards,
Mahesh -
AuthorPosts
- The topic ‘Title Tag in Category’ is closed to new replies.