WordPress.org

Ready to get started?Download WordPress

Forums

Better WordPress Google XML Sitemaps (with sitemapindex, multi-site and Google News sitemap support)
[resolved] Rewrite rules missing for custom posts and taxonomies (8 posts)

  1. crowinck
    Member
    Posted 3 years ago #

    This plugin causes WP_Rewrite to generate rewrite rules with custom post and taxonomy rules missing, therefore making links to those posts and taxonomies break when permalink setting is non-default.

    Problem can be intermittent but it's triggered when rewrite rules are flushed.

    Otherwise it's a great plugin, but this is a serious problem. Please fix.

  2. Khang Minh
    Member
    Plugin Author

    Posted 3 years ago #

    Hi crowinck,

    What is your current permalink settings? Do you have an example website so I may take a look? Or if that's not possible, a simple example might explain the issue better.

    Thanks.

  3. crowinck
    Member
    Posted 3 years ago #

    Permalink settings are at "day and name." I haven't tried the other non-default settings, but I doubt it would make a difference.

    Once the plugin is activated, and rewrite rules are flushed, permalinks to custom taxonomies (and almost certainly custom post types) lead to 404 pages. The problem is often corrected by resubmitting the permalink form (not just by visiting the permalink settings page) though I'm not sure exactly why. However, once anything in the system triggers a rewrite rule flush, it reappears.

    I took a peak at the wp_rewrite object and found that during problem periods all the rewrite rules for custom posts and taxonomies are missing.

    As soon as the plugin is deactivated, everything works fine.

    I could reactivate the plugin on our development version of the site, flush the rules, and make it public so you could see, but I don't think you'd get much out of it - just "yep, those custom taxonomy links lead to 404 pages." I'm happy to answer any additional questions you have.

  4. Khang Minh
    Member
    Plugin Author

    Posted 3 years ago #

    Thank you for your answers, crowinck, they are very helpful.

    This might be a conflict with the custom post types / taxonomies plugin you are using or the way you are adding them, though I'm not entirely sure either, because those custom things are working fine for other people.

    Anyway, may I have a list of plugins used on your site? And may I know how you register custom post types and taxonomies?

    Thank you.

  5. crowinck
    Member
    Posted 3 years ago #

    Akismet
    FeedWordPress
    Most Popular Posts
    postMash (Filter) - (hacked up version, but it doesn't make any rewrites or do other work with the rewrite object)
    Taxonomy Widget (I display tax links via this plugin and also custom widgets of my own, their behavior was normal)
    Term Management Tools
    User Role Editor
    Wordpress Video Plugin
    WP-DBManager

    Custom post types and taxonomies are registered by me via an action hooked to init. Futzing with the rewrite args made no difference (well, I could tell WP not to use rewrite for them at all, but that's not a solution so much as an ugly work-around). My code is pretty standard looking and too long to post here, but I could put it somewhere for display if you really want to see it.

  6. Khang Minh
    Member
    Plugin Author

    Posted 3 years ago #

    Hi,

    Futzing with the rewrite args made no difference (well, I could tell WP not to use rewrite for them at all, but that's not a solution so much as an ugly work-around).

    I don't want that either ;).

    Anyway, please send the block of codes you use to register custom things through the contact form here: http://betterwp.net/contact/. If it's possible, please send me the whole file in which you do that (functions.php?).

    Thank you.

  7. crowinck
    Member
    Posted 3 years ago #

    Sorry it took me a while to get back to you. I have a lot of function code split into 6 different files, so I wanted to replicate the problem in a setting that would eliminate most of that as the issue so you didn't feel the need to go through it all, and it took me a couple days to get to it.

    I have recreated the error on a different site on yet another server, it's version 3.1.2. It used a child theme of Twentyten with only one thing different - the functions that register custom tax and posts are added in. I will send you the code for that via your contact form.

    The only active plugins were yours and taxonomy widget - as an easy way to display the links. It was using the default settings of your plugin.

  8. Khang Minh
    Member
    Plugin Author

    Posted 3 years ago #

    Please update to 1.1.1 and tell me if it works for you, thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic