Skip Navigation

[Résolu] Search by parent and child posts and display parent and child posts counter

This support ticket is created Il y a 6 années et 3 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Ce sujet contient 24 réponses, a 3 voix.

Dernière mise à jour par vimalS Il y a 6 années et 2 mois.

Assisté par: Nigel.

Auteur
Publications
#1095972

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

With Relevanssi enabled can you try a standard WordPress search for 'por' and see what happens?

(If your theme doesn't add a search box, you can just type in lien caché)

#1095996

Can you mark my next reply as private so I can provide you with admin details?

#1096006

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Here you go.

This is a test server not a production site, right? I can change theme, de-activate plugins etc?

#1096028

Yes, but this is one where we are building site and makes live from here..
Please make sure it doesn't break anything

#1096100

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Screen Shot 2018-08-30 at 14.34.38.png

I see that with Relevanssi disabled the page works correctly (see screenshot).

When I activate Relevanssi it returns no results.

This page is using a View with text search.

When I visit the standard WordPress search page (lien caché) I see the same thing. Without Relevanssi it works correctly, with Relevanssi it returns no results.

So this appears to be a Relevanssi issue, because Views has nothing to do with the standard search page.

To make sure, I then disabled Views and checked again. With Relevanssi active and Views disabled, the standard WP search page still does not work.

You'll need to review the Relevanssi settings to see if you can identify something that might cause this problem (I'm not an expert in Relevanssi), and if not contact Relevanssi for support about the issue, there is nothing more I can do here, I'm afraid.

#1096742

Ok, I disabled relevanssi then It is working fine
Now, if I apply filter the parent and child posts count are not getting updated..
Why so?

#1096892

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Oh, you have other filters on the page as well as the text search (they are hidden in a dropdown).

Well, once again, the reason is "that your query takes no account of the filters that have been applied, so why should the results be any different each time the shortcode is run?".

I showed how you can update your shortcodes so that the custom queries you make to count the service and service provider posts are updated to include the same text search in the query, you will need to do something similar so that any filters that are applied to the View are also included in your custom queries (you will need to apply the same meta_query argument).

#1099286

Can you give me code?

#1099461

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Vimal

Writing and debugging custom code is outside our support policy.

I've already given you a big head start on improving your custom shortcodes so that they react to a text search, and what is required to respond to any other filters applied is very similar.

If there is a quiet spell in the queue and I have some time I will take another look and suggest some updates.

#1101319

I am going to built it custom