Hi Maja,
Thank you for reaching out!
Could you please provide more details about the issue you’re experiencing? If possible, could you share a screenshot or a short video of what you’re seeing in the search results? This will help us better understand the problem and provide you with the most accurate solution.
Looking forward to your response!
Best regards,
Brianvu-tp
Thread Starter
Maja
(@hutamanama)
Hi, sure here is the video: https://vimeo.com/1024986127/c7e2f4c147?share=copy
You can see under search results are full lessons and you can even download everything.
Thank you,
Maja
Hi Maja,
Thank you for sharing the video—it’s very helpful!
The issue is occurring because the WordPress search function includes all post types, including LearnPress course content, in the search results. To address this, we’ll need to exclude LearnPress lessons and other course content from the search.
Could you please let us know which theme you’re currently using? This information will allow us to provide a more tailored solution.
Looking forward to your response!
Best regards,
Brianvu-tp
Thread Starter
Maja
(@hutamanama)
Exactly 🙂 I am using Genesis, but this is probably a problem for all other themes as well.
-
This reply was modified 2 months, 3 weeks ago by Maja.
Hi Maja,
Thank you for the additional details!
After reviewing the issue, it appears that the search bar displayed on the 404 page is WordPress’s default search functionality, which we haven’t modified. To achieve the search results you want, you might need to customize this search to work more effectively with your theme’s setup.
If customizing the search bar presents any difficulties, we recommend reaching out to the Genesis theme support team, as they can help tailor the search functionality to best fit the theme’s design and your requirements.
Let us know if there’s anything else we can assist with!
Best regards,
Brianvu-tp
Thread Starter
Maja
(@hutamanama)
Not helpful…
But if anyone need solution – put this in function.php
/**
* Exclude Learnpress LESSON from Search
*/
add_action('init', 'excludePostTypeFromSearch', 99);
function excludePostTypeFromSearch(){
global $wp_post_types;
if(post_type_exists('lp_lesson') && isset($wp_post_types['lp_lesson'])){
$wp_post_types['lp_lesson']->exclude_from_search = true;
}
}
Hi Maja,
Thank you for sharing your solution!
We appreciate your contribution and close this topic here. Should you have any other questions in the future, please don’t hesitate to reach out.
Best regards,
Brianvu-tp