Forum Replies Created
-
AuthorPosts
-
23volt
ParticipantYou cannot access this content.
23volt
ParticipantYou cannot access this content.
23volt
ParticipantYou cannot access this content.
23volt
ParticipantThank you for your feedback friend.
I disabled the indexer mode but not i have all the time the samme qty of results:
https://wp-dreams.com/forums/topic/search-show-all-results/23volt
ParticipantYou cannot access this content.
23volt
ParticipantHello friend,
coud you explain please what we have to change for the first hook (asp_change_query_directly)?
So we can try this solution.BR
Tommy23volt
ParticipantHello Ernest,
thank you for your fast feedback.
I removed your customcode / filter from functions.php file. But the slow search query still resist.
I do not understand why the indexer not making the search faster. Do you have an ideaßSecond point:
If we enable indexer mode we cant have functions.php code to filter search?
If yes, i need to find a solution with normal mode (without indexer) with you. You can help us to make that search faster?
We also can pay for this job.BR
Tommy23volt
ParticipantSo if i wanna include also sub-parent 2 and sub-parent 3 i need to add their post id also.
Is this code correct:
if ( $id == 3 ) {
$args[‘post_parent’] = array(11748, 24547, 8787);I seperate the post id of each parent/level per comma. Thats right?
BR
Tommy23volt
ParticipantHi friend!
In our case the post have parent structure:
-> parent 1
–> sub-level 2
—> sub-level 3So the post this value in parent selector: Sub-level 3. The main-parent of sub-level 3 is parent 1.
With my code we query all posts with parent 1 and their sub-levels. But its not working. We see onyl posts with parent 1, but no posts with sub-level 2 or sub-level 2.Why its not working?
BR
Tommy23volt
Participant1. I am not a 100% sure, but from the output it seems like an incorrect post type was selected (something like “revision” or a similar name). Make sure that only the required post types are selected.
We have this results with all post types. I created new post type and select only this one in your plugin.
Then starting a serch. This ends also into this: Slides from elementor widgets are shown in search.Another possible issue might be, that the post statuses are entered incorrectly. On the same options page (Search Sources -> Post type search), make sure that only the publish post status is entered.
I checked this settings. We setup “publish” and we still see the elementor widget content in search result.
Last but not least:
When i remove your custom code the search does not show any content from elementor widget.
When i add your custom code into functions.php -> i see elements from slider widget again in the search.
So the issue depends to your code. You can help us if we pay for your work per hour?BR
Tommy23volt
ParticipantYou cannot access this content.
23volt
Participant23volt
ParticipantYou cannot access this content.
23volt
ParticipantHello Ernest,
but in your code here
add_filter( 'asp_query_args', 'asp_include_only_parent_ids', 10, 2 ); function asp_include_only_parent_ids( $args, $id ) { if ( $id == 3 ) { $args['post_parent'] = array(11748); } else if ( $id == 12 ) { $args['post_parent'] = array(3239); } $args['post_meta_filter'][] = array( 'key' => 'customfield', // meta key 'value' => 'abc' 'operator' => 'LIKE', // You can also try ELIKE here for more strict match 'allow_missing' => false // allow match if this custom field is unset ); return $args; }there is not this logic integrated:
If widget ID 3 –> post_parent = 11748 OR customfield = abc;
If widget ID 12 –> post_parent = 5000 OR customfield = xyz;There is a chance to archive this?
23volt
ParticipantWow, thats great. Please send me your paypal for a “thank you”. 🙂
One question i have.
How to have this please:if ( $id == 3 ) {
$args[‘post_parent’] = array(11748) OR customfield = abc;
} else if ( $id == 12 ) {
$args[‘post_parent’] = array(3239) OR customfield = xyz;So search widget with id 3 need to fit post parent id 11748 OR customfield abc.
And widget id 12 need to fit post parent id 3239 OR customfield = xyz.
Some posts are a customfield and some not.Do you can help us to solve that issue?
-
AuthorPosts