Skip Navigation

[Resolved] Search by parent and child posts and display parent and child posts counter

This support ticket is created 6 years, 3 months ago. 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.

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)

This topic contains 24 replies, has 3 voices.

Last updated by vimalS 6 years, 2 months ago.

Assisted by: Nigel.

Author
Posts
#1095972

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: 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 hidden link)

#1095996

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

#1096006

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: 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

Languages: English (English ) Spanish (Español )

Timezone: 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 (hidden link) 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

Languages: English (English ) Spanish (Español )

Timezone: 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

Languages: English (English ) Spanish (Español )

Timezone: 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