WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
Doesn't work on search results page (9 posts)

  1. mewing22
    Member
    Posted 3 years ago #

    This plugin works beautifully on every page except for the search results page. For example, when I search for the keyword "lamp," it indicates there are two 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. Has anyone figured out how to fix this?

  2. AlexLakes
    Member
    Posted 3 years ago #

    I noticed this too. WP page navi works great on index pages and archive pages. But doesn't show up on search (despite all my attempts to make it do so).

  3. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    @mewing22: Works fine for me.

    @AlexLakes: you have to add the wp_pagenavi() call in your search.php theme file.

  4. AlexLakes
    Member
    Posted 3 years ago #

    Works great. Thanks Scribu!

    Hey quick question. Does WP-PageNavi automatically add a trailing slash to the url of first page results? (e.g. If you are viewing page 2, 3, or whatever and click to view page 1, is it set to automatically add a trailing slash like so: /recipes/ )

    I'm trying to standardize on not using a trailing slash and can't seem to figure out if it's WP-PageNavi or my recipe plugin doing this.

  5. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    The trailings slash is added depending on wether you have one in your permalinks structure. See WP Admin -> Settings -> Permalinks.

  6. mewing22
    Member
    Posted 3 years ago #

    @scribu: So, you don't know how or why, it just works for you. Good for you. Not helpful for me.

  7. AlexLakes
    Member
    Posted 3 years ago #

    @mewing22, You could try posting your question on wordpress.stackexchange.com and be specific about what theme your using. It's worked for me in the past.

    @scribu, Thanks for the response. My permalink structure is /%postname% so this works as expected on most pages (/recipes/page/2, /recipes/page/3, etc). But the link to the first page still uses a trailing slash (/recipes/).

    Is it possible that wppagenavi adds a trailing slash to the first page expecting it to be the domain root http://www.domain.com/. But since this is an index for a custom post type at /recipes, wppagenavi is still treating this like a domain root and adds a trailing slash for that reason?

    (I'm just trying to standardize on one version for SEO reasons, /recipes.)

  8. mewing22
    Member
    Posted 3 years ago #

    @AlexLakes I'll try that. Thanks!

  9. vinx77
    Member
    Posted 2 years ago #

    You can easily solve it by installing this plugin http://wordpress.org/extend/plugins/search-permalink/

    This will create a permalink for searches, so yoururl/?s=someword will becomeyoururl/search/someword and page 2 yoururl/search/someword/page/2

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic