Title: Permalinks with categories don&#039;t work
Last modified: September 1, 2016

---

# Permalinks with categories don't work

 *  [gvh](https://wordpress.org/support/users/gvh/)
 * (@gvh)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/examplecomcategorypostpdf-returns-html-post/)
 * This is my second project where I get to use this plugin. Love this plugin.
 * This website has a static front page (example.com) and a blog page (example.com/
   blog) for posts.
 * Pages are working fine. They have no category in the url (eg example.com/page).
   Posts do not work. They have categories in their url (eg example.com/blog/category/
   post). Posts just return the html post when you add “/pdf” to their url.
 * Posts work fine when I change the post permalinks from /%category%/%postname%/
   to just /%postname%/ (ie. example.com/blog/post).
 * Any help appreciated. Thanks for a great plugin.
 * [https://wordpress.org/plugins/wp-pdf-templates/](https://wordpress.org/plugins/wp-pdf-templates/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Viljami Kuosmanen](https://wordpress.org/support/users/zuige/)
 * (@zuige)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/examplecomcategorypostpdf-returns-html-post/#post-7473367)
 * This might well be a limitation of the plugin. I would have to look into the 
   permalink to template resolving code to see if I can support permalinks like 
   that.
 * Would you be interested in looking at the code found here:
 * [https://github.com/anttiviljami/wp-pdf-templates/blob/master/wp-pdf-templates.php#L267-L299](https://github.com/anttiviljami/wp-pdf-templates/blob/master/wp-pdf-templates.php#L267-L299)
 * and see if messing with it would help your issue?
 * Cheers!
 *  Thread Starter [gvh](https://wordpress.org/support/users/gvh/)
 * (@gvh)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/examplecomcategorypostpdf-returns-html-post/#post-7473371)
 * Thanks. I’ll give it a try. Give me a day and I’ll get back.
 *  Thread Starter [gvh](https://wordpress.org/support/users/gvh/)
 * (@gvh)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/examplecomcategorypostpdf-returns-html-post/#post-7473462)
 * I messed around with the code L267-L299 as per your suggestion, but no luck. 
   These lines should be finding my single template just fine. And they do if I 
   just drop the category from the url.
 * I also briefly looked at the L207-L265 and could not see why the permalinks for
   urls with categories are causing problems. But there is no way I could write 
   code at that level, even though I can understand what you have written.
 * I’ve been trying to get these categories out of the urls anyway … urls too long.
   Who knows maybe they’ll go for it.
 * But please let me know if you feel this will end up being a limitation of this
   plugin. I will need to make other arrangements if I end up being stuck with these
   long urls. But I’ll wait on your response.
 * Thanks for your help. And great plugin. There should be more like it on the repo.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Permalinks with categories don't work’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-pdf-templates_ffffff.svg)
 * [WordPress PDF Templates](https://wordpress.org/plugins/wp-pdf-templates/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-pdf-templates/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-pdf-templates/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-pdf-templates/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-pdf-templates/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-pdf-templates/reviews/)

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * 3 replies
 * 2 participants
 * Last reply from: [gvh](https://wordpress.org/support/users/gvh/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/examplecomcategorypostpdf-returns-html-post/#post-7473462)
 * Status: not resolved