Forum Replies Created
-
AuthorPosts
-
sschoch
ParticipantHi, Ernest:
After discussing the options, we have decided to disable the Search Results pages altogether and only use the vertical results under the search box.
Thank you again for your timely responses and suggestions. You can close this ticket.
Stephanie
sschoch
ParticipantHello, again:
I have decided to abandon the idea of having the lessons appear in the Search Results page because, as you point out, the Learnpress authors did not design lessons to be opened outside of a course. So I was able to exclude them from the Ajax Search.
But, I discovered another issue. The vertical search results properly show results from both sites in the multisite setup; however, only results from the Site 1 (the site where the search box resides) appear on the Search Results page and none of the results from Site 2. I’ve included a screenshot of the Logic & Behavior settings.
I’ve tried using an index (making sure pages are indexed because Site 2 only has pages and not other post types) and not using an index, but can’t get results from Site 2 to show up on the Search Results pages. Is this also a theme problem?
sschoch
ParticipantHi, Ernest:
I think you are saying to add this line to one of the theme’s files…
$l = new LP_Lesson( get_the_ID() );
…but I am not sure which file to put it in. HelpGuru has a number of PHP with the word “search” in them. Any additional context you can provide so I can find the correct location?
And by “changing the result anchor link,” I think you mean an Ajax Search Pro setting, right?
Please advise and thank you for any help you can provide.
Thanks, Steph
sschoch
ParticipantHi, Ernest:
That worked, thank you.
Now, one more thing. When I include courses and lessons in the search and click the links in the results (either the drop-down list under the search box or the results page), I get a “Page Not Found” error. These all reside on the same site with the Ajax search box. I’ve included a screenshot of the post types added on the General Options -> Sources tab. Am I forgetting to do something?
sschoch
ParticipantHi, Ernest:
I added the code to the theme’s functions.php file. All of the links to the help site go to a page with a page ID of -10. Any ideas?
https://stage-help.netbase.com/cb/help/ic2/?page_id=-10
Thanks, Steph
sschoch
ParticipantHi, Ernest:
The problem I described above wasn’t accurate. I fixed it by turning on the option to have Ajax Pro replace the theme’s search. So the search results look fine now.
BUT, I do have another problem. You might remember that you gave me the code pasted in below to fix the issue where links to our online help system in the search results were going to post names, but the pages on the online help system use page IDs. This works great for links that appear in the live search results, but not when I click links on the Search Results page. Those still try to go to a post name.
Is there a modification you can make to the code below to make it work for links on the Search Results page also or is there another solution?
[code]
add_filter(‘asp_results’, ‘asp_try_fixing_permalinks’, 10, 1);
add_filter(‘asp_regular_search_result’, ‘asp_try_fixing_permalinks’, 10, 1);function asp_try_fixing_permalinks( $results ) {
$url = ‘Help site path’; // Change this to the help site path, like http://site.com
foreach ($results as $k => &$r) {
if ( isset($r->asp_guid) ) {
if ( strpos($r->asp_guid, $url) !== false ) {
$r->asp_guid = $url . ‘?page_id=’ . $r->ID;
}
} else {
if ( strpos($r->link, $url) !== false ) {
$r->link = $url . ‘?page_id=’ . $r->id;
}
}
}return $results;
}
[/code]sschoch
ParticipantHi, Ernest:
We found the problem–a conflict with the WPML plugin. Thank you for your message, though. You can close this ticket.
Stephanie
sschoch
ParticipantThank you for your reply. I did ask you suggested and as you predicted, the search doesn’t work even if Ajax is Network Disabled.
I did try replacing the default search with Ajax Pro on site A. It worked wonderfully except that when I clicked on More Results…, it went to the same “Nothing found” search page. Do you think it might be a problem with the Bootstrap theme?
sschoch
ParticipantHi, Ernest:
It worked! THANK YOU! I am pleasantly surprised at your helpful and PROMPT response. So appreciate your time.
Regards, Stephanie
-
AuthorPosts