• 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://www.ads-software.com/plugins/wp-pdf-templates/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Viljami Kuosmanen

    (@zuige)

    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

    and see if messing with it would help your issue?

    Cheers!

    Thread Starter gvh

    (@gvh)

    Thanks. I’ll give it a try. Give me a day and I’ll get back.

    Thread Starter gvh

    (@gvh)

    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.