Skip Navigation

[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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Dieses Thema enthält 20 Antworten, hat 3 Stimmen.

Zuletzt aktualisiert von Shane vor 4 Jahren, 4 Monaten.

Assistiert von: Shane.

Author
Artikel
#1676601

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?

#1680079

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!

#1682297

Or if that is absolutely not possible how can we display the additional posts below the original results instead of above?
Thanks

#1684363

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alexander,

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 .

Thanks,
Shane

#1686093

Hi Shane,

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.

Thanks,
Alex

#1686799

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Alexander,

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.

Thanks,
Shane