WordPress.org

Ready to get started?Download WordPress

Forums

Link Library
Search only providing results in active category (8 posts)

  1. rickpoet
    Member
    Posted 1 year ago #

    Hi,

    I've got the directory set up to allow my visitors to visit a page for each category of links. On each of those pages I've also included the Search shortcode. It works, but it only displays links within the category that the search was initiated from.

    Is there any way to get the search function to show results from all categories instead of just the one that the search initiated from?

    Thanks,

    Rick

    http://wordpress.org/extend/plugins/link-library/

    [ Please do not bump, that's not permitted here. ]

  2. rickpoet
    Member
    Posted 1 year ago #

    Follow up on this. I have 3 links categories. On each link category page I also have links to the other categories as well as a search box. In addition to the issue described in the post above, when I click on one of the links to the other categories, the search still only works from the initial category that I had navigated to. Is there anyway to get the search function to show results from all categories regardless of where the search is initiated from?

  3. CarolWP
    Member
    Posted 1 year ago #

    Let me know if you find an answer. I've been asking the same thing.

  4. CarolWP
    Member
    Posted 1 year ago #

    I finally found an answer! The first thing you need to do is to create a search results page. The search results page will have a title something like "Search Results," and the following two lines in it:

    [link-library-search settings=X]
    [link-library settings=X]

    where X is the number of a library that contains all your link categories.

    Next, go to that page. When seen on its own (not as a result of a search), it will have a complete list of all your links. Ignore that, because no one will ever see it. Now view the source of that page. There will be a bit in it that will read something like this:

    <form method="get" id="llsearch">
    <div>
    <input onfocus="this.value=''" value="Search..." name="searchll" id="searchll" type="text">
    <input value="2003" name="page_id" id="page_id" type="hidden">
    <input value="Search" type="submit">
    </div>
    </form>

    where the input value for the page_id will be your newly created page. Copy and paste all of that code into any page in which you want to have a form to search links, and save the page. Voila! You will have a search form that will search all your links, not just the ones on the page on which the search form is located. When someone uses the form, it will take them to your newly created Search Results page. However, the list of all the links will not appear on that page when it is found through the search function. Instead, that page will have only a search box and the results of the search.

  5. rickpoet
    Member
    Posted 1 year ago #

    Carol - You're a superhero! Thanks...just implemented your workaround on my various link library category pages and worked like a charm. Thanks so much!

  6. CarolWP
    Member
    Posted 1 year ago #

    I don't know about you, but this just stopped working on my pages. If the same thing has happened on yours, it can be fixed by changing the line that reads:

    <form method="get" id="llsearch">

    to

    <form method="get" id="llsearch" action="http://www.example.com/search-page">

    substituting the URL for your search page for http://www.example.com/search-page

  7. rickpoet
    Member
    Posted 1 year ago #

    Hmm...seems to still be working on my site http://poetrysuperhighway.com/psh/ (any page under the "Links" dropdown menu...but maybe it happened after a plugin update for you? Will keep this in mind in the event mine breaks again.

    Cheers,

    Rick

  8. yezzz
    Member
    Posted 1 year ago #

    In the library that outputs the links [link-library settings=X] is library X set up to show a limited number of categories?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic