Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm hoping somebody could help me out with the following issue. I have a wordpress page: http://www.howdesign.com/design-jobs and there is a list of jobs coming from behance.net via JavaScript. When you click on "Next Page" or a specific page number, the URL is supposed to be as follows: /design-jobs/?callback=Joblist.search.repage&page=2&sort=published_date&status=current

However, WordPress automatically takes the "page=2" and rewrites the URL as

/design-jobs/2/?callback=Joblist.search.repage&sort=published_date&status=current

(I was unable to post more than two URLs hence the shortened version). Notice the number 2 is now out of the query string and "page=2" was removed as well. This then breaks the pagination of the job listing on this page.

I was wondering if there is a way to disable this rewrite behavior for a specific page to allow the pagination to work correctly.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The redirect_canonical filter is responsible for this, which you can selectively disable depending on the requested page. This is untested, but should work:

function wpa66273_disable_canonical_redirect( $query ) {
    if( 'design-jobs' == $query->query_vars['pagename'] )
        remove_filter( 'template_redirect', 'redirect_canonical' );
}
add_action( 'parse_query', 'wpa66273_disable_canonical_redirect' );
share|improve this answer
    
Looks like exactly what I needed. Thank you much for your prompt reply. –  matr07 Sep 26 '12 at 15:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.