@limitcracker,
I am not familiar with FacetWP but base don the supplied snippets it appears to be passing data to a WP_Query, if that’s the case then yes, these snippets appear correct as “course” and “lesson” are the post types LifterLMS uses for courses and lessons (respectively) and “course_difficulty” is our difficulty taxonomy. You’ll need to verify whether or not the “terms” is correct based on difficulties you currently have on your site.
The final difficulty here is that LifterLMS Courses and Lessons are not searchable by default , this would not affect a WP_Query, unless there’s extra arguments added by FacetWP that obey the searchability of a registered post type. You opened another thread very recently about this which has a solution — please take a look at the solution proposed there https://ww.wp.xz.cn/support/topic/searchwp-issue-with-lifterlms?replies=6
Take care,
Thanks @thomasplevy
FacetWP author here, the issue is very likely due to the post types not being searchable. Good diagnosis.
More info: https://facetwp.com/documentation/faq/#facet-empty
@limitcracker After making those post types searchable (see the last link in Thomas’ reply), hit the Re-index button.
Cheers
Since Facet has confirmed my assumptions, let’s give you a better snippet to make both courses and lessons searchable:
function llms_post_type_searchable( $args ) {
$args['exclude_from_search'] = false;
return $args;
}
add_filter( 'lifterlms_register_post_type_course', 'llms_post_type_searchable' );
add_filter( 'lifterlms_lesson_post_type_course', 'llms_post_type_searchable' );
This will make both courses and lessons searchable.
Let me also note, however, that our INTENTION here is that lessons and courses both contain content which should only be available to ENROLLED students. By making this content searchable that content can now be discoverable by non-enrolled students.
That might be totally fine for you but we added this during our initial beta because our beta testers overwhelmingly concurred that this content should NOT be searchable. We’re probably going to add some better search functionality and options in the future but that’s where we stand today.
Take care,
Hi! Thnx for the replies!
@thomasplevy do you think there is a way to only make specific parts of a course searchable. i.e. only the Title or the Course Category that is into?
Br,
@limitcracker,
As far as I know this is not possible via WP_Query or standard WordPress searching methods. It’s conceivably possible as *everything* is conceivably possible but I’m not sure how to go about helping you with that as we’re starting to deal with customization for your website alone.
If you do some research and find some things I’m happy to direct you on the implications given the LifterLMS codebase but I can’t come up with anything *easy* enough to answer with a code snippet.
Sorry,
Thank you for your quick responses! Being searchable it’s ok by me for now.