WordPress.org

Ready to get started?Download WordPress

Forums

WP Query Search Filter
plugin doesnot work (21 posts)

  1. queeneve
    Member
    Posted 1 year ago #

    when i activate my plugin and start to customize it i receive the message

    Warning: Invalid argument supplied for foreach() in /home/schoolsi/public_html/wp-content/plugins/wp-query-search-filter/wp-query-search-filter.php on line 146

    Warning: Cannot modify header information - headers already sent by (output started at /home/schoolsi/public_html/wp-content/plugins/wp-query-search-filter/wp-query-search-filter.php:146) in /home/schoolsi/public_html/wp-includes/pluggable.php on line 881

    and when i use the search form on my website , it doesnot work , it only gets the whole search of the posts , even if i use a keyword that is not on the site ,

    any help please?

    http://wordpress.org/extend/plugins/wp-query-search-filter/

  2. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Have you add taxonomy in the search?

  3. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    already updated new version..Try it out and see if the problem is fixed.

  4. queeneve
    Member
    Posted 1 year ago #

    i tried the new version

    the error in the dashboard is not appearing anymore

    but the search widget on the website is not working properly

    I am sure that this plugin is what I need but I still I cannot use it
    is these any documentation for it?

  5. queeneve
    Member
    Posted 1 year ago #

    when i use any search form it gets all the posts of the site , even when i use keywords not on the website

  6. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Can you describe more on how the widget not working properly?
    Did you select the post types that you want the search to go through?

  7. queeneve
    Member
    Posted 1 year ago #

    dear ron
    thanks for help

    please check this link , in the search widget choose in the area the word Roushdy

    http://goo.gl/Bxxeh

    this word is not in the blog itself , but when i search you will find all the posts appear in the results area

  8. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    Did you set the Boolean relationship between the meta queries?
    You should select AND, so that the search must meet the requirement of all your input. If you use OR, the search will bypass the result from "Roushdy" but still got the result from your Level value.

    Note that, even you left empty on "Search All" Text, the search will still go through 'all' of your meta value. So if i choose 'Roushdy' in Area, and click search. Then the search will still go through your 'Level' meta key with all the meta values. So if a post have a 'Level' meta key it will be shows at the result.

  9. queeneve
    Member
    Posted 1 year ago #

    1) I choose the Boolean relationship to be AND
    2) I donot want to use the Taxonomy , so I use only the Meta feilds
    3) all the fields now are fake , in other words no post has the tag with the name of "area1, area2,Level1 "
    4) still I have all posts appear in the results

  10. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Okay, I see what is your problem.

    The search is make use of WP_Query features.
    Which mean it doesn't really 'search' the post, it just filter. The plugin works like this way.

    1. Fetch all the posts from the post_type you selected in the plugin.(if you have not selected post type in the plugin, then it will get all of your posts from all post type including post, page, custom post type etc)

    2. From the posts that get from step 1, it will filter the posts and get the posts matches your meta key.

    3. From the posts that get from step 2, it will filter the posts again and get the posts that match the meta value.

    Your problem is, your process stop at step 2 because there are no meta key found, thus it will get back to step 1, which is why you get all the posts.

    My advise, try some real meta key and value, then you will see the result.

    Also you can goto see the documentation of WP_QUERY, to get better understand of the concept.

  11. queeneve
    Member
    Posted 1 year ago #

    I tried real values but it still shows that whole posts of the site
    is there any direct email that i send you print screen or wp credentials to check it?
    thanks

  12. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    Well, you can goto here to get my email.

  13. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    @queeneve, I just update the plugin. Try it and tell me if it is work.

  14. pandypop80
    Member
    Posted 1 year ago #

    Firstly, the plugin looks great and is just what I need. However, I am having similar issues getting it to filter through my items and work correctly.

    I am currently working on a website which sells narrowboats. The end user will simply use the website to search for a suitable boat, then email/phone to purchase/view the boat.

    The search criteria is categorised in four sections - size, style, price and location. The owner has two locations where they sell the narrowboats from, which I have added in my menu anyway as a drop down from 'Boats For Sale'. I was the planning on creating a simple thumbnail button for each boat, which would go to the specific page listing size, style, price etc and also show some images in a gallery. I have done all of that in pages, rather than posts/categories.

    Search by keyword works correctly - but that's only if you know what you are looking for. When I use the drop downs for each category there is never a search result, even if I leave each one as 'All' for each.

    Are you able to give me some advice on this matter please and point me in the right direction.

    I look forward to a reply.

  15. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    @pandypop80,
    Correct me if I am wrong - you are using page instead of post for publishing your boat listing. If this is the case, as i know by default categories can only be assigned to posts, not to pages in WordPress. How do you categories your boat listing in size, style, price and location? Note that, the dropdown search form is not actually 'search' the keyword, in fact its filter the keyword from categories and taxonomies. It is using WP_QUERY for this filtering. Thus, the plugin will only work if you have categories/taxonomies assigned to your page.

  16. pandypop80
    Member
    Posted 1 year ago #

    Thanks for your swift response.

    If you drop done size it's in feet, style is the different style names, price starts at £30,000 then moves up by £10,000 each time up to £60,000 and location is just the two locations. As mentioned previously each boat will have it's own listing with images and describing text. The idea would be the user could look for a 40 foot boat, cruiser style, priced at £40,000 at one of the locations. Each boat listing will have information relating to each category.

    Would I need to create four categories - size, style, price and location? Then using your plugin create a meta tag for each, such as boatsize, boatstyle, boatprice and boatlocation? Once I've done that create a post for each boat listing making sure it has all four meta tags attached? Then do I add the hyperlink for each post to the thumbnails on their respective pages?

    Can you please confirm if that's what I need to do next. Again, I really appreciate your help on this matter.

  17. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    @pandypop80,

    Would I need to create four categories - size, style, price and location?

    Yes, you will need to create four categories for your listing. But since you are using page for the listing, you will need to add the categories manually, because by default, page does not support category.

    then using your plugin create a meta tag for each, such as boatsize, boatstyle, boatprice and boatlocation?

    Well, it is taxonomy in the plugin if you using category.

    Once I've done that create a post for each boat listing making sure it has all four meta tags attached?

    Yes, you MUST add your defined category in your listing, otherwise the plugin wont found your listing.

    Then do I add the hyperlink for each post to the thumbnails on their respective pages?

    The plugin using your theme default search.php to display the result. Usually the link is added in the search page by default. As for thumbnail, you will need to customize the codes in your search.php.

    In my opinion, I think you should using custom post type instead. By using post types, you are able to do more customization and features. You can assigned four taxonomies to your custom post type. There are many plugins to help you to create custom post type and taxonomy out there.

  18. pandypop80
    Member
    Posted 1 year ago #

    @ron_dev

    Thanks for the quick reply once again. I have had a look at your comments and gone back to amending the site.

    I believe your plug in is what I require - I feel that I am almost there with it.

    Right, I have created four categories (Parent categories) - Boat Size, Boat Style, Boat Price and Boat Location. I then created more categories, generating the hierarchy such as 10 feet, 20 feet, 30 feet which went below Boat Size and so on...

    I then created a boat listing post (copying the same text and images from the previously created page), I checked the categories which related to the listing - location, size, cost and style.

    Once that was sorted I created four category taxonomies using the plug in - Boat Size, Boat Style, Boat Price and Boat Location.

    However, when I refreshed the site - the four taxonomies (drop down filters) I had created had all of the categories listed under each section, rather than the specific categories for the titles.

    The search worked fine, I just assumed that as I created a hierarchy of categories with the parent ones having the same name as the taxonomy, the drop down options would have paired up some how. Basically I require the category hierarchy to match up top the search filters created - four main sections, with separate drop downs, not having all of the same options.

    Is there any way of doing that, I assume there is, as that's how I originally had it looking using the custom meta option - even though that would not have worked. I have also seen that way of filtering options on other websites.

    I look forward to your advice on the above.

  19. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    @pandypop80,

    The plugin currently work with parent category. That's why you will see all the section under parent category. That's why I recommend you using custom taxonomy.

    However, the taxonomies that I meant is the 'post' taxonomy, not the 'category' taxonomy. You can use plugin such as this to create your post custom taxonomy.

    When you have custom taxonomy in your boat listing, then you will no longer need your category anymore, because taxonomy is identical to category but with more feature. If you have created custom taxonomy, let say 'Boat Size', then in the plugin, you can add 'Boat Size' in the form. And you can see that all the 'Boat Size' values (that you added to your boat listing post eg. 10 feet, 20 feet, 30 feet ) as your dropdown option in the search form in the front end.

  20. pandypop80
    Member
    Posted 1 year ago #

    BINGO! I can't thank you enough for that advice - your plugin works just as I wanted it to now I have added the recommended one by yourself.

    I can't stress how happy I am at this moment. Thanks again!

  21. TC.K
    Member
    Plugin Author

    Posted 1 year ago #

    @pandypop80,
    You are welcome. Glad that your problem is solved. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.