• adrien44

    (@adrien44)


    Hello,

    Just a quick note — I’m using the latest version of the plugin, and permalinks are no longer working correctly.

    URLs no longer take the hierarchy into account (parent / child).
    For example: domain.com/parent_cat/child_cat returns a 404 error. You need to remove parent_cat from the URL for it to work.

    I had to add the following code to my functions.php file to get it working properly:


    add_filter('wpsl_store_category_args', function($args)

    // Assure que le slug reste identique

    $slug = isset($args['rewrite']['slug']) ? $args['rewrite']['slug'] : 'store-category';

    $args['rewrite'] = array(

    'slug' => $slug,

    'with_front' => false,

    'hierarchical' => true

    );

    return $args;

    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • farroyo

    (@farroyob)

    Hi there, thanks for writing.

    Thanks for letting us know, I’ll forward this to the dev team so they are aware of it.
    Best regards,

    Thread Starter adrien44

    (@adrien44)

    I’d like to point out that the canonical URLs are broken (incorrect) as a result. I haven’t worked on a solution yet.

    Thread Starter adrien44

    (@adrien44)

    if (is_tax('wpsl_store_category')) {
    $term = get_queried_object();

    if ($term instanceof WP_Term) {
    $correct_url = get_term_link($term);
    if (!is_wp_error($correct_url)) {
    return $correct_url;
    }
    }
    }
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘permalink not working correctly’ is closed to new replies.