[Gelöst] display specific posts to filter search results no matter of searched term
This support ticket is created vor 4 Jahren, 5 Monaten. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
The Mothership post does appear in search results now, though I'm not sure about the other results because I'm not clear how the postal code search should work. Can you take a look and let me know if the other results are accurate? Is search working correctly?
Hi Christian, thank you. Works almost good.
The defined posts appear in search results now. Just wondering if it is possible to have the posts in alphabetical order all together? Now the defined posts appear on top of the results.
Thanks!
As Christian is currently unavailable due to his vacation, I will be stepping in here.
We actually won't be able to sort this because of Relevanssi. On our view edit page you will see the following notice
Since you are using a text search with Relevanssi, the order of results may be according to relevance and not according to this selection. If the visitor searches by text, the results will be ordered by relevance.
This essentially means that once you've performed a text search your view will be ordered based on relevance .
I know that the results are sorted by Relevanssi but in this case we are displaying specific posts above the results and the idea was to merge all the posts and sort them alphabetically but if that is not possible than display the results first and below the other specific posts. (at the moment its is the other way)
So the question is, how we have to adapt the code from christian (or which code shall we add to the functions) to display first the results and below the posts giving by the code.
I tried looking on the documentation for this hook on the relevanssi documentation for how to do this but I wasn't able to find any documentation that could achieve this.
It will respect the sort order that is defined in views. There must be a sortable value that will always ensure that this post is in the position that you want it.