WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. pmbs
    Member
    Posted 3 years ago #

    Hello,

    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
    Member
    Posted 3 years ago #

    Same problem here... any luck?

  3. pmbs
    Member
    Posted 3 years ago #

    Nope, not yet. Still hoping!

  4. FamousFish
    Member
    Posted 3 years ago #

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

  5. pmbs
    Member
    Posted 3 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
    Member
    Posted 2 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:
    http://your-site.com/category/example/?ssort=_ratings_score-pm&sdir=desc

    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
    Member
    Posted 2 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

About this Topic