WP Smart Sort
[resolved] 404 Error with pretty permalinks (7 posts)

  1. pmbs
    Posted 4 years ago #


    After I changed my permalinks to pretty (http://domain.com/%postname%/) the WP SmartSort-addon won't do the job.

    When you enter a category or tag page the default sort works, but when you try to change to another sort option from the drop down list, the url will change to domain.com/category/playstation-3/sort/_post_title-pp-asc/ and you get an 404 error.

    Anyone know a solution? :)

  2. ryanbednar
    Posted 4 years ago #

    Same problem here... any luck?

  3. pmbs
    Posted 4 years ago #

    Nope, not yet. Still hoping!

  4. FamousFish
    Posted 4 years ago #

    Yeah it works on default permalinks, but not SEO friendly ones. A fix would be nice...

  5. pmbs
    Posted 4 years ago #

    Yup. Tried to look into it myself, but not to experienced.

    If anyone could make a fix for me (and others), take contact.
    I am willing to make a donation/pay a minor fee for it.

  6. msnfull
    Posted 4 years ago #

    I found a solution!
    Using the following code, you can keep your current "fancy" permalinks, but let wp-smart-sort use "ugly" ones.

    1. Open /wp-content/plugins/wp-smart-sort/wp-smart-sort.php
    2. Go to line 257 and find:

    if ($this->ss_use_permalinks()) {
                        $option['asclink'] = $this->ss_get_current_context_url() . 'sort/' . $option['nicekey'] . '-asc/';
                        $option['desclink'] = $this->ss_get_current_context_url() . 'sort/' . $option['nicekey'] . '-desc/';

    3. Replace with:

    if ($this->ss_use_permalinks()) {
                        $url = parse_url($this->ss_get_current_context_url());
                        $url = $url['scheme'] . "://" . $url['host'] . $url['path'] . "?" . $url['query'];
                        $option['asclink'] = $url . '&ssort=' . $option['nicekey'] . '&sdir=asc';
                        $option['desclink'] = $url . '&ssort=' . $option['nicekey'] . '&sdir=desc';

    Example URL output:

    It's not perfect, as the plugin still doesn't generate "fancy" links, but you can at least get it to work again on your website.

  7. pmbs
    Posted 4 years ago #

    Cheers mate!

    It's working, more than good enough! Thanks alot! *hugs* :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Smart Sort
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic