0

looking for some help with a permalink structure problem. I am using this code here http://pastebin.com/QfgAMkfV as a plugin with hopes of creating a structure like so

/films/
/films/film-name/
/films/genre/genre-name/
/films/topic/topic-name/

This works, but I cannot display normal pages (pages not posts). I don't get a 404 error, instead I am just getting the latest post, which is coming from the index.php file.

If I disable permalinks everything works fine. I have tried changing to the default theme, updating permalinks, even changed server and re-installed wordpress.

Is this possible without using a plugin?

  • your code works fine for me, no issue with pages. you probably shouldn't be flushing rewrite rules on admin init though, but it's not breaking anything. – Milo Nov 28 '13 at 5:03
  • I usually comment that out. – Shannon Hyland Nov 28 '13 at 5:17
  • I have noticed a .htaccess.swp file appearing and then disappearing. I am not sure what this file is, any ideas? – Shannon Hyland Nov 28 '13 at 5:21
  • a linux swap file? not sure. when you enable pretty permalinks, an htaccess file gets created, and when you revert back to default permalinks, the htaccess rules get deleted, so that may explain why the file appears and disappears. I'm not certain though. I don't know that it would have anything to do with your issue. htaccess rules are the same for any pretty permalink format, it basically just passes everything to WordPress and the parsing is done internally. – Milo Nov 28 '13 at 5:32
  • ok. thanks. So any ideas on how to fix this problem? – Shannon Hyland Nov 28 '13 at 5:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.