Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Groups in results don't link correctly
This topic contains 6 replies, has 2 voices, and was last updated by michigangamers 5 years, 10 months ago.
- AuthorPosts
- January 6, 2018 at 4:20 pm #16184
When doing a search on the site, any group from BuddyPress that it finds links are incorrect. They come up like:
https://www.michigangamers.net/?post_type=gpages&p=1658I have custom permalinks enabled for https://www.michigangamers.net/%category%/%postname%/ so the link should look like:
https://www.michigangamers.net/groups/the-gaming-annex/It seems to only be the group links that are doing this, everything else is linking correctly.
January 8, 2018 at 12:03 pm #16199Hi!
I’ve looked up the plugin source, but I believe it should return the correct link, as it uses the default BuddyPress method to request the permalinks, so I’m not sure what the cause is yet.
I have custructed 2 different custom code solutions that may help resolving this. Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case. Let me know if you need help with these.
Try this one first:
..if the first one does not work, remove it, and try this one:
Let me know!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 8, 2018 at 7:07 pm #16215If I add either of those to the functions.php file, I get the error 500 code. Also, I noticed that it does not seem to be searching users.
Attached is my functions.php if that helps at all. I’m using the theme Flash by https://www.thinkupthemes.com/
Attachments:
You must be logged in to view attached files.January 9, 2018 at 3:01 pm #16229You are right, there was a tiny mistake in both cases. Can you please try it again:
Version 1:
Version 2:
To search users, please make sure the user search is enabled under the General Options -> User search panel: https://i.imgur.com/8LYeFCJ.png
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 9, 2018 at 7:37 pm #16232OK, neither of those worked. Some more information.
The group with the image at the top is linked correctly, but the second option is the same as the first and isn’t linked correctly. If we could get rid of that it would be good.
As to the user search, it is enabled and isn’t working.
Attachments:
You must be logged in to view attached files.January 10, 2018 at 1:37 pm #16241That clears it up, I see the issue now.
The second result is not actually the group, but a custom post type called ‘gpage’, which I believe you don’t want to be returned. Make sure to remove these items from the custom post type section, it should solve the issue: https://i.imgur.com/kRNORlM.png
The use search issue is, that all the user roles are excluded, that excludes all users: https://i.imgur.com/3oRynO1.png
Best,
Make sure to remove some or all of those exclusions, and it should start working.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 10, 2018 at 4:52 pm #16247Thank you, I thought I needed the Groups Page for it to search the groups, and I cannot believe I missed that exclude for the users.
Thank you.
- AuthorPosts
You must be logged in to reply to this topic.