Jump to content
Sign in to follow this  
tfalkowski

Changing Tags to Categories

Recommended Posts

tfalkowski

Sorry for the newbie level question.. I was wondering how I go about changing the section of the blog post "Tagged with" to instead display Filed under Categories with a list of the categories for the selected post? Thank you in advance, -Thomas

Share this post


Link to post
Share on other sites
bryan-hadaway

This is going to take custom PHP edits, are familiar with PHP? Thanks, Bryan

Share this post


Link to post
Share on other sites
tfalkowski

unfortunately no, although if I knew which file to make the edits in and the appropriate variable names, I could probably figure it out. Thanks, -Thomas

Share this post


Link to post
Share on other sites
cmunns

There's actually a shortcode you can use at the bottom of the posts `[post_categories]` to list the categories associated with it. Then you can hide the tags with css `.tags {display:none;}`

Share this post


Link to post
Share on other sites
tfalkowski

Adam - .tags{display:none;} did not seem to remove the tags from either the posts in the loop or on the singe posts page. :-/ -Thomas

Share this post


Link to post
Share on other sites
cmunns

Where did you add the CSS? It should work as is? Do you have a link to the site?

Share this post


Link to post
Share on other sites
tfalkowski

I added it to the custom css section in the settings panel. No link to a live site, only running in dev on my local host. -Thomas

Share this post


Link to post
Share on other sites
bonngean

Thomas, As Catrina said, adding the code to base.css will make your post tages disappear from display. I just added:

	.tags{display:none;}
	

into my base.css file and it worked. Have you tried it yet? How To Find Base.css file: Go inside of the section of Wordpress named: Appearance >> Editor and then choose the base.css file to add the code above. --Bonnie

Share this post


Link to post
Share on other sites
tfalkowski

Ok, that did the trick. The tags section is now gone. :-) But how do I get it to display: Filed under the categories:[post_categories] where the tags used to be? You guys are a wonderful support forum. I really appreciate all of the help every one has provided. Again, Thank you in advance, -Thomas

Share this post


Link to post
Share on other sites
catrina

Filed under the categories:[post_categories] <- You want this in the footer of the post, correct?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
tfalkowski

Yes, where the Tags used to display. -Thomas

Share this post


Link to post
Share on other sites
kastelic

Just type that line in at the bottom of your post.

Share this post


Link to post
Share on other sites
tfalkowski

ok, but I would rather not have to do that on every post. Surely, there is a way to easily add this in.

Share this post


Link to post
Share on other sites
timlinson

Hey Thomas, this filter should do the trick. Place this code in your child theme's functions.php file. `function content_add_categories($content) {` `? ? $content .= 'Filed under the categories: [post_categories]';` `? ? return $content;` `}` `add_filter('the_content', 'content_add_categories');`

Share this post


Link to post
Share on other sites
tfalkowski

Tim - You sir, are a rockstar! Thank you so much. -Thomas

Share this post


Link to post
Share on other sites
tfalkowski

Ok, One last question and I will stop beating this dead horse.. I promise. Is there a way to turn a feature off only on a specific page.. i.e. I want the categories to show on the main posts page but not on the single posts page -Thomas

Share this post


Link to post
Share on other sites
timlinson

You can add a conditional in the function :) `function content_add_categories($content) {` `? ? if(!is_single()) {` `? ? ? ? $content .= 'Filed under the categories: [post_categories]';` `? ? ? ? return $content;` `? ? }` `}` `add_filter('the_content', 'content_add_categories');`

Share this post


Link to post
Share on other sites
tfalkowski

Tim - That seemed to remove the entire post on the single-posts page. -Tom

Share this post


Link to post
Share on other sites
timlinson

oops, move `return $content;` below the brace `if(!is_single()) {` `? ? $content .= 'Filed under the categories: [post_categories]';` `}` `return $content;`

Share this post


Link to post
Share on other sites
tfalkowski

Thanks Tim, That did the trick. -Thomas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×