Hide All Courses in particular Course Category

Home Forums Legacy Support Support queries Other issues Hide All Courses in particular Course Category

Viewing 15 posts - 16 through 30 (of 46 total)
  • Author
    Posts
  • #238855
    logan
    Member
    Hello, you can add your category name here: https://share.getcloudapp.com/xQu0qxdy
    #238986
    Zatakk
    Spectator
    This reply has been marked as private.
    #239010
    Diana
    Participant
    This reply has been marked as private.
    #239203
    Zatakk
    Spectator
    Hi Still waiting pls
    #239225
    Diana
    Participant
    @zatakk, Apologies for the delayed response. The filters remain same, only slight change in the function Use this function function wplms_exlude_courses_directroy_cc($args){ if($args['post_type'] == 'course'){   $excluded_courses=vibe_get_option('hide_courses'); if(!empty($excluded_courses)){ if(!empty($args['post__not_in'])){ $args['post__not_in'] = array_merge($args['post__not_in'], $excluded_courses); }else{ $args['post__not_in'] = $excluded_courses; } } //print_r($args);   $args = array( 'post_type' => 'course', 'tax_query' => array( array( 'taxonomy' => 'course-cat', 'field' => 'slug', //can be set to ID 'terms' => 'technology' //if field is ID you can reference by cat/term number ) ) );   $category_posts = new WP_Query($args);   if($category_posts->have_posts()) : while($category_posts->have_posts()) : $category_posts->the_post(); if(!empty($args['post__not_in'])){   $args['post__not_in'][] = array_merge($args['post__not_in'], $excluded_courses);   }else{   $args['post__not_in'] = $excluded_courses; } endwhile; endif; wp_reset_postdata(); } //echo "<pre>"; print_r($args); return $args;   }  
    #239325
    Zatakk
    Spectator
    Hi I gave following input only 'term' = "p-ce" where "p-ce" is the slug for category. But nothing is happening. I am using child categories for this "p-ce". I have also tried on category that has no child. Not working.
    #239499
    Diana
    Participant
    This reply has been marked as private.
    #239539
    Zatakk
    Spectator
    This reply has been marked as private.
    #239629
    Diana
    Participant
    This reply has been marked as private.
    #239662
    Zatakk
    Spectator
    Hi I have added the filter, but I think its working in a totally different way. Instead of hiding the courses which are mentioned, its only showing those categories which are coded. Because of that, What has happened now is the following
    1. Even if I click on any category, only those which are coded are being shown. Means all the filters which were earlier applied, dont work now. For example
    https://www.constructionworld.online/course-cat/bldg/ => shows same courses https://www.constructionworld.online/course-cat/adv/ => shows same courses https://www.constructionworld.online/course-cat/brdg/ => shows same courses https://www.constructionworld.online/course-cat/hws/ => shows same courses These are all available on the home menu and can be accessed even without login. We have come very close but still missing by a big margin may be.... I have given all the details to you, can you pls check from your end if its working or not. We are going so much in loop for this, could you kindly close in one go. Appreciate the time and effort. Regards
    #239844
    Anshuman Sahu
    Keymaster
    Yes we are close we need to put some kinda check there  . Can you please confirm do you wish to show hidden courses when someone applies its category filter from Buddypress course filter widget and also on its category page ?
    #239873
    Zatakk
    Spectator
    Hi I want to hide a particular category of courses from everywhere. Should not be visible even if the category filter from Buddypress course filter widget nor on its category page.   Irrespective of any other course category(parent or child) that is given, lets say I add the category 'hidden', then these hidden courses are to be totally hidden in any filters, any pages and even in the count of the total courses. They cease to exist for any record purposes. The reason why I need this is 1.  When I am creating the course and editing it.
    1. When the course has been live for sometime but now needs some new content to be added.

    2. I am not able to delete the course for whatever other reason and not even make it a draft.

    3. Live courses need to be tweaked for whatever reasons and still need to be acessible through a link but not from front end.

         

    #239997
    Diana
    Participant
    @zatakk, Got your point and here you mentioned that you have to maintain the count as well. This will require a slight  tweak in the above shared code.   Need to go through the above code again. Now, it's a bit difficult to maintain the child as well as parent category
    #240422
    Zatakk
    Spectator
    Hi Any progress please
    #240504
    Diana
    Participant
    @zatakk, I can update you by monday. Apologies for this delay
Viewing 15 posts - 16 through 30 (of 46 total)
  • The topic ‘Hide All Courses in particular Course Category’ is closed to new replies.