0

This is a two parts problem.

1) I want to replace the custom post type with custom taxonomy term on my permalink. By default my URL structure is:

http://example.com/holiday/remote-brazil

holiday = CPT

remote-brazil = CPT item

I also have a custom taxonomy term for that.

adventures = CTT

My desired URL is:

http://example.com/adventures/remote-brazil

I solved the problem simply adding this line on the custom post type registration:

'rewrite' => array('slug' => '%holiday_category%','with_front' => false),

holiday_category = custom taxonomy.

It seems to be too easy :-) Is it that or am I missing something?

2) Now the problem. I'm using a commercial theme with regular updates (that's good), but if I make any changes there I'm surely that will lose them. My question is how do I write a plugin that will overwrite(or add) that specific line on the CPT from my theme?

Cheers.

2
  • Don't ever make any changes to that theme you are using. You will loose all the changes you made if you update that theme. Most themes today like the default themes from wordpress are child themeble. You should be able to able to create a child theme for the theme you are using. It takes less than five minutes to do, is super easy, and very very important, if you update the theme you are using, you don't loose your customizations, this will safe tonnes of tears later on. Commented Jan 30, 2014 at 11:05
  • I'm aware about that. I want to know how to do that using a plugin.
    – Daniel
    Commented Jan 30, 2014 at 14:20

0