Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterStrange, that should be working.
I’ve looked through the code, I can only see one case where this might be an issue. Is this happening when clicking on the “Show more results” link?
I might be able to re-create the problem, if that’s it. Will get back to you if I find something.
November 20, 2015 at 1:09 pm in reply to: How do I make a search box on the top of the results page? #6683Ernest Marcinko
KeymasterHi!
It depends on your theme structure and functionality. You will most likely have to add the search PHP shortcode into the results page file. This file is located in your theme folder, it’s usually the search.php file.
There is a short chapter in the documentation on how to use the PHP shortcode in themes: https://wpdreams.gitbooks.io/ajax-search-pro-documentation/content/getting_started/search_shortcode_in_themes.html
Unfortunately the plugin cannot place itself automatically there, as it is not possible in WordPress.
Ernest Marcinko
KeymasterHi!
I’ve invesitvaget the results override problem on my test environment, and there is indeed an issue when the grouping is enabled. I took some time and most likely fixed this problem within the new version (4.6). I’m attaching the release candidate version to this post, please install it, it should solve the problem with the missing results on the default wordpress results page. However grouping on the results page is not possible to add by the plugin. It’s fully controlled by the theme, and I believe it’s only possible to do by changing the code completely in the search.php file in the theme folder.
I’ve also looked if there is anything I can do about changing the order of the post type groups, but I’m afraid there is nothing I can do right now. Grouping in general is probably the most complicated part of the plugin right now. I’m planning to completely re-work the whole grouping thing with more options, right now it’s a bit too strict and not too friendly. Your request seems fair and square, but the current state of the grouping mechanism does not allow such action unfortunately 🙁
You can exclude pages by IDs or by parent-child structures on the Advanced Options -> Content panel (scrolling almost to the bottom): https://i.imgur.com/4qW0S3l.png
The options says Exclude Posts by ID’s (comma separated post ID-s), but it works with pages and custom post types as well 🙂Also, this custom CSS code should solve the z-index issue:
[code]
.promagnifier,
.prosettings {
z-index: 0 !important;
}
[/code]-
This reply was modified 10 years, 7 months ago by
Ernest Marcinko.
Ernest Marcinko
KeymasterHi!
I think I understand what you need, but I think I can’t do anything about it. Let me explain why:
Currenly the plugin is redirecting to this specialized results list, which we discussed before, by editing the url to:
?field_c7a95a576f13bbb32f0a479d41c2ae58={phrase}&s=&serialized=1&action=pfs
Because of this custom redirection, the plugin search engine is not used. The reason is, that this redirection uses most likely a custom search engine specialized in searching for these shops, and it’s very different from the built in WordPress default search engine. The ajax search pro, can only override the default WordPress search engine, because it’s coded that way. But because this default engine is not used in your case, ajax search pro cannot override it.
Basically what happens now is this:- User types in the search query, hits enter button
- Ajax Search Pro gets the request, and by configuration it redirects to the url given
- The corresponding theme code recognizes this URL and starts it’s own search
- After searching the theme displays the results on this specail results page
So in this case ajax search pro is only a mediator to the theme search engine.
The only possible way to look for those fields is to change the configuration or the code of the acting theme search, that displays that special results page. I hope you understand 🙂
November 19, 2015 at 8:31 am in reply to: website shifts position when using exsisting search field #6668Ernest Marcinko
KeymasterHi!
I think I see why the website shifts 🙂 It’s actually a weird coincidence. Something besides the plugin adds an additional class to the document body, called “fixfixed”. This CSS class is also used by ajax search pro, but it has a different definition. The fix is very easy. Just use this CSS code:
[code].fixfixed {
position: inherit !important;
}[/code]You can either add this to the custom CSS section of your theme, or use the Theme Options -> Custom CSS panel on the search instance options.
As for the placement: It’s extremely hard to tell which file and where to exactly edit, as there are over 15 million different themes out there, and each one is using a different codebase. Therefore I would really love to give you clear step-by-step instructions, but it’s just simply not possible. It would require for me to know the source code of all the versions of all the themes out there.
Based on what I can see the current search bar is placed in a div container, possibly in the header.php file in your theme directory ( wp-content/themes/{your theme name}/ ). It’s most likely there, but it varies from theme to theme. I would look for this code fragment in the header.php file:
[html]<div id="search-box">
……
</div>[/html]or something very similar. Inbetween the div tags there is either a PHP function or more HTML code, I can’t tell from the page source, but it does not matter anyways.
After locating this fragment, I would try changing it to something like:
[html]<div id="search-box">
<?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]’); ?>
</div>[/html]Make sure the id in the shortcode corresponds with the search ID you have created. If you created one, then it’s probably 1: https://i.imgur.com/B6sjrRh.png
Then save the file and see what happens. There is a good chance it’s still going to be misalignment or incorrect width, as the site header was probably built for that exact search form. Based on the first look, I would also use this custom CSS code on the search-box container to make sure the width is not exceeding 100%:
[html]#search-box {
max-width: 300px;
}[/html]This is as much as I can do after the first look.
Ernest Marcinko
KeymasterHi!
Make sure you purge the page/minify/CDN and every possible cache where the plugin is active after turning off the override.
The plugin might be getting the old settings if the page is cached. You can confirm the page is served cached content by searching for
[php]"overridewpdefault": 1,[/php]
string in the page source code.
Ernest Marcinko
KeymasterHi!
By default the plugin uses Relevance based ordering. First of all, you need to disable this function, as it acts like the primary sorting: http://i.imgur.com/waAZFv0.png
Then on the General Options -> Ordering panel you can set up the results ordering, which will work now as the relevance based ordering is disabled: http://i.imgur.com/lPxirfc.png
This option is going to be changed in the upcoming version to make relevance and other ordering types work together more smoothly.
Ernest Marcinko
KeymasterHi!
I’m guessing this is stored in a custom field?
The only possible explanation I can see in this case is that there are lots of posts ending “123” and then beginning “123”. There is no difference searching 3 or 4 digits on database level, so if it works on 4 digits, it must work on 3 as well.
The case is probably that for example the limit is set to 10 posts. The plugin passes the query to the database and it returns the first 10 matching results with the highest relevance. If the first 10 matching contain 123 either on the beginning, the end or in the middle it’s immediately returned. In this case the relevance is the same for any case.I think I might have a solution though 🙂 If you are indeed using custom fields, then open up the wp-content/plugins/ajax-search-pro/includes/search/search_content.class.php file and go to line 813 and 824, the two lines should be identical, something like:
[code]$parts[] = "( $wpdb->postmeta.meta_key=’$cfield’ AND …[/code]
Then, add this line just below both of those two lines:
[code]$relevance_parts[] = "(case when ($wpdb->postmeta.meta_key=’$cfield’ AND " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like’" . $_like . "%’$suf_like) then 50 else 0 end)";[/code]
This will increase the relevance in case the search string is found on the beginning of the word by 50, which ensures that those results are displayed first. I just tested this, it seems to be working as expected.
Let me know if anything changes!
Ernest Marcinko
KeymasterHi!
Sure! On the General Options -> Behavior panel turn off these options: http://i.imgur.com/VFRdg92.png
If you only want to disable the pop-up results when typing, then only turn OFF the Trigger search when typing? option.
Ernest Marcinko
KeymasterYou are welcome 🙂
You can find how to add the search shortcode to your theme here: https://wpdreams.gitbooks.io/ajax-search-pro-documentation/content/getting_started/search_shortcode_in_themes.html
It’s the php shortcode you are looking for. On the search settings page you click on “Toggle shortcodes for…” and the PHP theme shortcode will appear: http://i.imgur.com/tMRextS.png
If you like plugin, you can rate it on your codecanyon downloads page if you want to 🙂
Ernest Marcinko
KeymasterHi!
1. If I get correctly, you want to completely disable the ajax results. No coding is required 🙂
Configure the General Options -> Behavior panel as following: http://i.imgur.com/r5ATjnW.pngThe search won’t activate when typing, and will redirect to the results page when hitting enter or the search icon.
2. I’m not sure if that is possible, but I guess we can try. I’ve examined the current form, and it redirects to a custom results page, not to the default one.
Form redirection: http://trova.com.my/web/?field_c7a95a576f13bbb32f0a479d41c2ae58=test&s=&serialized=1&action=pfs
Default search: http://trova.com.my/web/?s=testBut, there is an option in Ajax Search Pro that might work without coding. On the same options panel (General Options -> Behavior) there is an option: Redirect to url? The default value is: ?s={phrase}
Based on the url above, change the value to: ?field_c7a95a576f13bbb32f0a479d41c2ae58={phrase}&s=&serialized=1&action=pfs
Screenshot: http://i.imgur.com/jnPUJZy.png
Let me know if that works!
Ernest Marcinko
KeymasterHi!
I’ve managed to get in. My configuration was correct all along, I had to reset my router and modem, I have no idea why. Seems like my ISP is doing strange stuff.
The good news is, that I’ve found why the theme is not displaying any results. After some reverse engineering I’ve found that the inlcudes/loop.php file is handling out the results in the theme directory. It basically separated them into 3 groups, but it wasn’t working correctly for some reason.
I didn’t want to change that file, and I noticed that you are using a child theme, so I’ve made a search.php file in the child theme directory. WordPress automatically looks for this file, and if it exists, then it’s automatically considered as the search results handler. I’ve copied over the original index.php content and the corresponding part of the includes/loop.php file, and I made a correction not to filter anything. Now this search.php file is entirely handling the results content.
I did not change any of the code, only the search.php file was created, so this should be update-proof as well.
I did a few tests, and it looks like it’s working correctly, and handling the results as expected 🙂
If you want to change layout of the search page, or anything regarding it, you can do it by editing the organic_shop-child/search.php file.
Ernest Marcinko
KeymasterHi!
Sorry for the late response, I had an emergency update work on due to an upcoming chrome update.
I’ve tried to connect with the given details, but I’m getting the following error:
[SFTP] Connection failed : Failed to resolve hostname serverb.****.it (This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server. )
Unable to connect
I’m guessing either the host name or the port is incorrect? Or maybe I have to add something to my local hosts file?
Ernest Marcinko
KeymasterHi!
I’m glad you like the plugin 🙂
Unfortunately neither is possible yet. I’m planning to re-design the whole filters section in the future, so there is definitely going to be an author, ordering and other new filters as well. If there was like an easy modification to do it right now as a temporary solution, I would help you, but unfortunately it’s a lot more complicated.
Luckily I’m updating the plug-in regularly, so this is going to happen 🙂
Ernest Marcinko
KeymasterIt tells which posts to display, but not the layout. The layout depends on the theme, and cannot be overwritten unfortunately.
-
This reply was modified 10 years, 7 months ago by
-
AuthorPosts