Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterHi,
Thank you for the details!
Some special themes may have custom made search bars, which the theme author may program not be be replacable automatically. In those cases the only possible way is to either programmatically replace or use the plugin shortcode.
In your case the theme search bar redirects to a custom made search results page, which I guess is specifically made for the integrated theme search. These custom query pages usually does not work with other search plugins. In your case the WordPress search results page is this: https://advisortattoo.it/?s=uno
That is a bit different from what the homepage custom search integrates to.Ernest Marcinko
KeymasterOkay, I see how this works now. Without coding this is not possible, but it should not be too difficult whatsoever.
Your code looks surprisingly perfectly fine to me, very good job – but I might be able to suggest a way based on that so you don’t have to use an additional field.Instead of that code, try this:
add_filter( 'asp_results', 'asp_add_extra_field_data', 10, 1 ); function asp_add_extra_field_data( $results ) { foreach ($results as $k=>&$r) { $slug = $r->post_type; $taxname = get_field('published_year', $r->id)->name; $origin = get_field('originator', $r->id)->name; $enjoyed = get_field('date_enjoyed', $r->id); $tipwrit = get_field('writer', $r->id)->name; $enjoydat = get_field('enjoyed_at', $r->id)[0]->post_title; $tippub = get_field('publication', $r->id)->name; $strung = $slug . ": " . $taxname . $enjoyed . $tipwrit . ', ' . $origin . $enjoydat . $tippub } return $results; }Please be very careful and have backups! I may have made typos, as I am not able to test this.
PS: Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterIt could be I think. For displaying results initially try the auto-populate feature, and for the products filter box try the post type filter.
October 20, 2023 at 4:03 pm in reply to: Removing 'the' from search results and front end filter question #45775Ernest Marcinko
KeymasterThank you, that worked!
I think I found the problem, your primary ordering is set by “date descending”, make sure to change them up like this: https://i.imgur.com/db1ehVu.png
.. so relevance is primary and whatever is secondary. That will do the trick 🙂Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
Generally repeaters are very problematic to display as they are rendered differently for each case.
Are the ingredient names by any chance actually assigned to the recipe? In that case using the
{__tax_ingredient_name}(replace ingredient_name to the actual ingredient name taxonomy) could work.Ernest Marcinko
KeymasterHi Alex,
I’m afraid that may not be possible unfortunately. I would suggest a custom script to somehow make it happen, but unfortunately the filters only hold the category ID on the client side. To make a redirection to the category page that information is not sufficient, because in WordPress it is not possible to redirect to a term page via the term ID (as far as I know).
October 19, 2023 at 9:55 am in reply to: Removing 'the' from search results and front end filter question #45761Ernest Marcinko
KeymasterFor now I think WP Admin access should be sufficient. I only tried that, but for some reason it does not let me in. Can you please try making a new user? Thank you very much!
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
October 18, 2023 at 3:30 pm in reply to: Removing 'the' from search results and front end filter question #45753Ernest Marcinko
KeymasterHi Chris,
Thank you very much for your kind words, I do try my best to answer and help with everything I can.
The reason for not recommending filters is purely for better pefromance. The index table uses so called indexed queries, which is a database feature, but there are certain rules that a query needs to obey for the database engine to use the index and not to switch to different methods automatically.
This is the main reason the index table can be significantly faster and less resource heavy. Adding filters to the mix is going to reduce the chances significantly of having indexed queries and the database will use different methods more often – because with filters table joins must be used and joining a huge set of data with another to get the connections between the objects can be resource heavy.Still, you can try them, it very heavily depends on the datbase and the exact scenario. If you see significant slowdown, then it is probably because of that. You can also the index plugin to make more indices on some of the core tables, that can help greatly.
As for the second issue, I need to check, however I can’t login with the details. Can you please check the username and the password?
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts