Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

We have a live site that is using one theme. Then I've got Wordpress Mobile Pack installed to enable a mobile theme which has different functionality and look. The problem I'm running into is that the live site uses a CPT for a "specials" page. This obviously has to be updated in the permalink structure in order for the url to work correctly. SO, when the mobile pack switches the theme for the mobile version, the permalink structure is killed and the CPT archive and single pages will not work. It doesn't mess up the main site, and the mobile version works perfectly, except that the CPT will not display.

And yes I have copied all the code into functions.php as required to handle the CPT.

Questions to be answered:

  1. First off, am I correct in assuming this is the actual problem or am I missing something here?
  2. Is there a way I can force the mobile theme to create that permalink structure when it recognizes that a new theme has been activated?
  3. If 1 and 2 are not possible, what is another option for me to still use the CPT. This is highly important to the site as it carries the "specials" they want to allow people to pull up on their phones.

I've already thought that I may have to setup a separate install of wordpress for the mobile site and do browser detection/redirect. I would hope this is not the only option for many reasons but mostly because I don't want them to have to manage two admins. Any help thoroughly appreciated!

share|improve this question
add comment

2 Answers 2

It sounds like you need to move your CPT out of your theme functions and into a plugin. Otto on Wordpress has a good tutorial for how and why.

share|improve this answer
    
I could but that seems like overkill...anyway, I figured it out and noted it here. Thanks for your input though! –  igobyjared Nov 18 '11 at 2:49
add comment
up vote 0 down vote accepted

Once again I answer my own question. For anyone having issues...it's

flush_rewrite_rules();

Just tag it onto the end of your CPT and VOILA! PRESTO! SHAZZAM! I found it after much searching and much heartache so hopefully someone else will come along and find this helpful.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.