• Resolved inspireddev

    (@inspireddev)


    Hi

    I’ve been building a site for a few weeks now and have had to build a custom taxonomy for Woocommerce product, so as well as categories a product has a collection it can be applied to. I have a custom taxonomy template setup, everything appeared to be working fine.. After leaving the site for a week and a Woocommerce update the Collections taxonomy has stopped functioning. Instead it 301s then redirects to a similar URL. If I disable permnalinks everything works fine. Enable again and it redirects.

    So basically this URL –
    …/product-collection/pentewan/ (taxonomoy)
    Flat out redirects to –
    …/interiors/pentewan-collection/ (page)
    And its ruining my life.

    If I disable the Page that its redirecting too then it will simply 404.

    My set up is pretty straight forward, and nothing has changed except a Woo update.

    Taxonomy setup code is as follows –


    register_taxonomy(
    'product_coll',
    array('product'),
    array(
    'label' => __( 'Collections' ),
    'hierarchical' => true,
    'query_var' => true,
    'has_archive' => true/*,
    'rewrite' => array(
    'slug' => 'product-collection'
    )*/
    )
    );

    There was a rewrite rule but I disabled it for testing, still, no affect, and I’ve cleared the htaccess by toggling permalinks many times… Usual stuff has been done – disabling plugins etc, and because I’m on a temp domain error logs don’t appear to be populating, however I can obviously expose errors on the site itself and theres nada issue. The only thing I can relaly find is via Firebug, and thats simply telling me that it is 301ing before it redirects.

    Any help or suggestions is greatly appreciated, Its a funny one and I’m not even sure where to start debugging really..

    Thanks again for your time – Anthony

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Does your code happen to use WP_Query::get_queried_object() anywhere? There’s some issues with that method, see https://core.trac.wordpress.org/ticket/27015 .

    The issue is related to rewrite rules because permalinks use them regardless if you have added others or not. Even if the above trac is not your issue, something is likely trying to make something out of the query vars, which can be quite different when permlinks are on. I would start debugging by examining anything that is getting query vars for any reason.

    Thread Starter inspireddev

    (@inspireddev)

    This was the culpret.. Thank you so much for you assitance! Seriously I’m still confused as to how it was working fine for a while and then just flat out died after a week of usage, but it was related to object quries, all sorted now!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Taxonomy only works with permalinks off’ is closed to new replies.