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 using Dilectio theme and WP-PageNavi plugin. The plugin creates links to multiple pages perfectly on every page except for the search results page.

For example, when I search for the keyword "lamp," it indicates there are 2 pages of search results. When I click on page 2, it takes me to page 2 of my blog, not page 2 of the search results. Can someone please help me fix this?

share|improve this question

2 Answers 2

Dilectio theme comes with an old version of WP-PageNavi plugin embedded in its functions.php file, so the best thing you can do is just remove the wp_pagenavi function form the functions.php, install the plugin and you should be set.

share|improve this answer
    
I just checked the demo of the theme and searched for 'the' and the same thing happens. –  Bainternet Apr 17 '11 at 1:18
    
Thank you for your response, but it seems I already did that. The old version is missing from the functions.php file, and the newest version of WP-PageNavi is installed and activated on my plugins page. Hmmm. Now what? –  user4726 Apr 17 '11 at 6:46
    
Can you post a url to search results? –  Bainternet Apr 17 '11 at 8:26
    
Nope. That must be the problem. The url for search results comes up as a generic craftynest.com/index.php So, the plugin isn't the problem, the theme is, correct? –  user4726 Apr 18 '11 at 4:40
    
Thank you, Bainternet! I wouldn't have figured it out without you. –  user4726 Apr 18 '11 at 9:20

I discovered that the problem was in my theme's searchform.php file. I changed the form method from "post" to "get." Now search queries show up in the url address. Before: <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> After: <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> Problem solved.

share|improve this answer
    
Use echo esc_url( $_SERVER['PHP_SELF']; );. See Data Validation. –  toscho May 18 '11 at 9:02

Your Answer

 
discard

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