1

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?

2 Answers 2

1

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.

1
  • Use echo esc_url( $_SERVER['PHP_SELF']; );. See Data Validation.
    – fuxia
    May 18, 2011 at 9:02
0

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.

5
  • I just checked the demo of the theme and searched for 'the' and the same thing happens.
    – Bainternet
    Apr 17, 2011 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, 2011 at 6:46
  • Can you post a url to search results?
    – Bainternet
    Apr 17, 2011 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, 2011 at 4:40
  • Thank you, Bainternet! I wouldn't have figured it out without you.
    – user4726
    Apr 18, 2011 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.