Forums › Forums › Search & Filter Pro › Need some custom work done to results.php
- This topic has 10 replies, 4 voices, and was last updated 9 years, 4 months ago by
Ross.
-
Anonymous(Private) June 19, 2015 at 9:40 am #19837
or perhaps just another solution may work? i see there is a file class-search-filter-setup-query.php, perhaps you can add and ignpre_sticky_posts somewhere? this would work for me. a more appropriate solution would be just displaying the results including sticky posts if they match the search query.
Anonymous(Private) June 19, 2015 at 6:27 pm #19871Are you using a custom post type for your Ads? If so, on the “General” tab for the search filter you can exclude that CPT by ensuring that the box is UNchecked.
You can still make custom post types “sticky” via a plugin called “Seamless Sticky Custom Post Types”….it’s the best way I’ve found to add support for “sticky posts” to Custom Post Types.
If you’re not using a CPT for your ads, post back how you are doing it, and I may be able to suggest a way to eliminate them from the search query.
Anonymous(Private) June 19, 2015 at 10:01 pm #19884Hey Ryan, were you intending to post a private reply to Ross (the developer)? Normal forum users such as myself, who are trying to help others, cannot see private replies.
If that was your intent, no worries, if not and you still need help, I’m willing to see if I can help you if you’ll repost your reply and not check ‘set as private’.
Anonymous(Private) June 19, 2015 at 11:27 pm #19886Here is what I posted above. Thanks
Hi Trisha thanks for responding.
The custom post type is not the problem, I have selected the correct one for the search form. When I do a search the proper post type is included. The problem is, when using the sticky function, When I do a search sticky posts, regardless of whether they match the search query are being displayed.
For example, I do a search with criteria where no posts should match.
The search result page displays: Search for โ*โ returned 0 results
However, the sticky posts are there.
Anonymous(Private) April 8, 2016 at 12:33 am #42013Ryan/Ross, I’m having the same issue.
I need to use sticky posts on a client’s site but they show up in the results even if they do not match the search criteria. They are too sticky. The behavior I want to see is that when the user first lands on the archive page the sticky posts are listed. As soon as the user performs a search the sticky posts should be ignored and those posts should only show up in results if they match the search.
Is there a solution for this?
Ross Moderator(Private) April 11, 2016 at 3:42 pm #42303Hey Keith I’m afraid not.
In our WP queries we just pass the sticky param through – ignore_sticky_posts – https://codex.wordpress.org/Class_Reference/WP_Query
Unfortunately this does not take into consideration the other search options… I’ll look into the improving this so there will be another option which would only show stickys if they matched all search criteria.
I’ve stuck this on the todo list for now.
Thanks
-
AuthorPosts