Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterHi again!
Actually I have never though of the plural forms. I’m going to re-work grouping options within 2 updates, so I might as well add some kind of option to define singular-plural forms.
So, I have tried something and it work on my test server. The good news is, that it does not need any modification in the search code, so it’s kind of update proof. However this will only work with non-grouped result list. Add the following code to the active theme functions.php file:
[php]add_filter( ‘asp_pagepost_results’, ‘asp_add_categories_to_results’, 1, 1 );
function asp_add_categories_to_results( $pageposts ) {
$category_res_arr = array();foreach ($pageposts as $k=>$v) {
// Get the post categories
$post_categories = wp_get_post_categories( $pageposts[$k]->id );
$cats = "";// Add each category as result to the result array
foreach($post_categories as $c){
$cat = get_category( $c );
$new_res = new StdClass();
$new_res->title = $cat->name;
$new_res->content = "";
$new_res->image = "";
$new_res->author = "";
$new_res->date = "";
$new_res->link = get_category_link($cat->term_id);
$category_res_arr[$cat->term_id] = $new_res;
}
}// Merge the posts and the categories together
return array_merge($pageposts, $category_res_arr);
}[/php]This basically gets every category for each post and appends it at the end of the posts results array. It should handle duplicates, so each category should appear only once.
I’m doing fine, thank you for asking 🙂 Actually, I’m going to Montenegro next wednesday for a week with my family. I can’t wait to get some rest from the computer. Norway sounds fantastic in these hot days. I’ve never been there, my sister once was, she said it’s a wonderful country. You will surely have a great time.
Anyways, let me know if this code works for you, or if you need something else.
Ernest Marcinko
KeymasterHi Eno!
It’s nice to hear from you again, I hope you are doing fine 🙂
Sorry I didn’t answer today, I had a few priority issues to solve first. I’ve read through your request and I think I might be able to put together a snippet to append the categories to the result list.
I just got home, so I’m done for today, just wanted to let you know that I have read your ticket. Tomorrow morning, when I’m back I will most likely post a solution, I have something on my mind, it might work, just need to test it first on my test servers 🙂August 4, 2015 at 2:34 pm in reply to: Search results are different when search inside WP and Woocommerce #5493Ernest Marcinko
KeymasterHi!
The results are the same, only you have no width set to the result images and it’s displayed incorrectly.
I have set the image width back to the default 70 pixels on the search settings page. It should display correctly now – once your browser cache is emptied. (refreshing by CTRL + SHIFT + R)
Ernest Marcinko
KeymasterYou most likely turned off the settings. Frontend Search Settings tab, Show search settings switch on the frontend? option.
Ernest Marcinko
KeymasterHi!
Well, it’s a little more complicated than that unfortunately.
There are like 10 different plugins I know to extend user fields, and each of them use a different way to store the extra data related to the profiles. While it seems fairly easy to just grab those data and index them, on the other side it’s extremely complicated due to the nature of how WordPress stores users and user data.
On top of that the current state of user search with Ajax Search Pro is not the best, but luckily I have already implemented a much better one to the upcoming version. I still cannot promise though that it will be possible to search those fields.The new will support the so called “user meta”, which is a database table for storing any amounts of key->value pairs for each user in the WordPress system. So if the membership plugin you are using uses this standard way of storing these data, then it will definitely work.
Ernest Marcinko
KeymasterHi!
You had the Compact Layout mode enabled on the Layout Options – Compact box layout panel, that’s why it was only showing the icon: https://i.imgur.com/zR2LqlG.png
For the isotopic layout you will have to change the Search input field background gradient color option on the Theme Options -Input Field layout tab as well, because the input is basically the same as the box and it hovers over it.
Basically the input is stretched over the background, it gives the metro-like look.Ernest Marcinko
KeymasterHi!
This usually happens if a 3rd party plugin invokes a javascript error before rendering. It can also happen if the theme javascript files are loaded on the back-end as well (where they shouldn’t).
I can’t tell exactly unless I see it, but you can try 2 things:
- Swtich the theme temporary to the default, and see if it works then.
- Turn off every other plugin but the search and try then (or you can turn them off 1 by 1)
If it doesn’t help, you can include temporary back-end details to your ticket and I may be able to tell where the error originates from by checking the error console.
Ernest Marcinko
KeymasterHi!
Well, nothing is executed on deactivation, so I can only guess.
- Do you have any custom code in your theme functions.php file or anywhere else that requires the plugin?
- If you activate the error reporting in the wp-config.php file what error message do you get on the front page?
- Were there any modifications made to other plugin files, that may include or require files from the ajax-search-pro plugin?
- If you have any type of cache plugins active, make sure you empty all caches. Some caching plugins use object cache, which might have stored variables and shortcode callbacks from plugins and tries to access the search, yet it’s not active anymore.
I’m guessing it’s some kind of remaining custom code requesting something from the plugin in the theme header.php or somewhere similar, which triggers a fatal error since the plugin is no longer active.
If you enable the error reporting, I’m sure something will show up. Let me know if nothing helps.
Ernest Marcinko
KeymasterHi!
You will have to disable the pages on the Content Options panel: http://i.imgur.com/d56otTN.png
More info in documentation: Content OptionsAlso, if you want, you can turn off the content filling, but it’s not mandatory: http://i.imgur.com/dIedAGI.png
More info about filling options: General BehaviorErnest Marcinko
KeymasterHi!
I think maybe. Try to activate the Search in terms? (categories, tags) option on the General Options -> Sources panel. That should do the trick.
But if you mean returning these tags as results, then it’s probably not possible.
Ernest Marcinko
KeymasterHi!
You are welcome!
On the advanced option panel on the bottom there is an option for that. By default it’s enabled.
Ernest Marcinko
KeymasterHi!
Indeed, it was a known issue. Since you gave me ftp, I appended the missing code for taxonomy translations, it should work correctly now.
The upcoming version will have the fix included, so you don’t have to worry about the updates.
July 31, 2015 at 3:32 pm in reply to: How to display only parent category ( not subcategories) in result list #5461Ernest Marcinko
KeymasterHi!
Currently it’s unfortunately not possible. The grouping algorithm moves the result to each category where it belongs.
I will try to make an option for the next update to only show the result in the first category if possible.
Ernest Marcinko
KeymasterHi!
Yes indeed, it is a bug in the current version. I have solved it within the upcoming version, which should be out soon. Unfortunately I don’t have a quick fix as of yet, it affects more than one file.
Once the update is ready, it’s going to fix it 🙂
Ernest Marcinko
KeymasterAdditionally, if you don’t want to use a widget or shortcode on page to display the search initially, you can use the template shortcode and add it directly to your footer. The footer is usually printed through the footer.php file in your theme directory.
More info on search shortcodes in themes here. -
AuthorPosts