Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

How to flush the cache on terms?

Hi Wondering if someone could shed some light. I am using CPT UI plugin. I changed my terms names in the dashboard. Then I reset my permalinks and refreshed, but the url still shows the old term names and breaks the page (shows a white blank page). Is there a way I can flush my terms cache to reset it? I tried displaying the same info that was on my broken page on another page and it works. So I'm thinking it's the terms. Any clues?

Signed, Desperate in Hoboken

5 Answers

Thanks Zac. I did find a solution that I would like to share. The reason the urls were not changing was that it was not calling my taxonomy template. So with much searching I found this magical code:

<?php the_terms( $post->ID, 'eventnames', ' ', ', ', ' ' ); ?>

It needed its own line, because once I popped it into my template, I realized what it does. It displays a link that calls my taxonomy-eventnames-term.php templates! The url was now correct, and all was right with the world. So I replaced the permalink code, which you would normally use to link to your custom post, and that's how I got it to work.

Question, though: Do permalinks not work with taxonomies?

And further question: How can I make the above code display something other than the TITLE as a link? Because I want the link to say, "MORE DETAILS". Seems like it would be so simple but I can't find the answer.

Anyway, getting back to my solution, I then created 3 taxonomy-eventnames-term.php templates, each one called their respective terms, meaning the names of each event, and it worked.

Honestly seems like there could have been a step I could have saved, for instance making only 1 taxonomy.eventnames.php template and calling each event term with a conditional statement. Would that work?

Zac Gordon
Zac Gordon
Treehouse Guest Teacher

Glad you worked it out! Permalinks should work by default. What are they showing for you?

Could you try posting up a separate thread about changing what's displaying? There should be a filter or something for that.

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Not sure this is a caching issue. I would try resaving or possibly deleting and starting over if it's not too far along. You may want to try their support forums if it doesn't work.

Yes, will do!

aHA! the lightbulb just went on in my head, sparked by your reply. Permalinks. I think I need to change my url path in my TAXONOMY to match the permalink path. Stay tuned, I'll let you know if it works. Thanks!

Yes, that worked. I used 'events' (my custom post type name) as my slug and the paths matched up. Make sure to refresh your settings > permalinks and you'll be golden.