Home › Forums › WPLMS AddOns › WPLMS Batches › Remove course batches heading for non-login and non-member
- This topic has 13 replies, 3 voices, and was last updated 7 years ago by H.K. Latiyan.
Viewing 14 posts - 1 through 14 (of 14 total)
-
AuthorPosts
-
March 6, 2017 at 11:27 am #99171stefSpectatorHi, Is that possible to hide COURSE BATCHES HEADING for non-login user and non-member of the batches? Thanks a lot regards stMarch 6, 2017 at 3:25 pm #99302H.K. LatiyanParticipantOk here is what I understand from this. => You want to hide all batches from the course page for non logged in users. => If there are 3 batches in the course and the user is enrolled in only 1 batch then you want to show only that batch on the course page. screenshot: http://prntscr.com/egpqgp ------------------ Well the first part is easy and it can be done by a small php code, but the second one is not possible as there is no filter present in the file as of now. This is first time someone has requested this and therefore we had not added any filter there. However you can hide the batches list from the course page for all users from the course settings, refer: http://prntscr.com/egps35 If you want then we can add a filter there in our next update and then I can provide you a small code which will fulfil your second requirement.March 9, 2017 at 11:16 am #99957stefSpectatorHI, I have connected batches to some courses. The member of the batch will see in the course batch header and batch description. However, non-user of the batch and non login user, only see the header: Course batches ------------------------------------- Can we remove this course batches that has no content below the header? But I do not want to remove course batches with the content - for member of the batches thanks stMarch 9, 2017 at 1:15 pm #100000H.K. LatiyanParticipantCan you please share a screenshot for clarifying the issue.March 9, 2017 at 1:32 pm #100011stefSpectatorThis reply has been marked as private.March 10, 2017 at 11:52 am #100214H.K. LatiyanParticipantThis reply has been marked as private.March 10, 2017 at 12:01 pm #100219stefSpectatorNo, I did not put any code. I just use standard features of WPLMSMarch 10, 2017 at 12:48 pm #100237H.K. LatiyanParticipantPlease let me know which feature you used to hide the batches from non batch members.March 10, 2017 at 12:53 pm #100240stefSpectatorI did not do anything.... It is hidden for non members from the beginning..March 11, 2017 at 1:06 pm #100453H.K. LatiyanParticipantThen I guess you have set the batch/group as hidden, because the hidden groups are not visible to non group members. Assuming you have set the batches as hidden, try adding the bellow code in your wplms-customizer.php file present in your wplms customizer plugin OR the functions.php file of your child theme (if using a child theme): add_action('bp_after_course_header',function(){ if(is_user_logged_in()){ ?> <script> jQuery(document).ready(function($){ var check = $('.course_batches').find('.enrolled'); if(typeof check == 'undefined'){ $('.course_batches').hide(200); } }); </script> <?php }else{ echo '<style>.course_batches{display:none !important;}</style>'; } }); Let me know if this helps.March 11, 2017 at 1:10 pm #100454stefSpectatorThe code you have provided is actully hide the group above the curriculum including for the members of the group.March 14, 2017 at 1:44 pm #100902H.K. LatiyanParticipantPlease remove the previous code and try adding the bellow code instead: add_action('bp_after_course_header',function(){ if(is_user_logged_in()){ ?> <script> jQuery(document).ready(function($){ var check_batch = $('body').find('.course_batches'); if(typeof check_batch != 'undefined'){ var flag = 0; $('.course_batches li').each(function(){ if($(this).hasClass('.enrolled')){ flag = 1; } }); if(flag){ $('.course_batches').hide(200); } } }); </script> <?php }else{ echo '<style>.course_batches{display:none !important;}</style>'; } });April 26, 2017 at 9:19 pm #109079HorizonCMESpectatorI have the same question as question #1 on this inquiry. I've chosen to hide the batches for guests (users that aren't logged in), but the "Batches" heading still shows up on the Course page, which is a little confusing to users. How can I hide this as well for users until they log in?April 27, 2017 at 2:56 pm #109252H.K. LatiyanParticipantHi.. Can you please share the url of the course where the batches heading is shown to non logged in users.
-
AuthorPosts
Viewing 14 posts - 1 through 14 (of 14 total)
- The topic ‘Remove course batches heading for non-login and non-member’ is closed to new replies.