Hide Course Page Menu

Home Forums Legacy Support Support queries Styling issues Hide Course Page Menu

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #216713
    [email protected]
    Participant
    Hello, I would like to hide the Course Menu "Home" just like I am able to hide. Activity, Members and Group. E.g. show only to Instructors. It makes no since to have "Home" shown on its own without any other tab visible.
    #216740
    [email protected]
    Participant
    I found this but it only works if I remove "if ( is_singular('course')". So this does not work: add_action('init', function(){ if ( is_singular('course') ){ if( !current_user_can('edit_posts') || !is_user_logged_in() ){ echo '<style>.single.single-course.c6 #item-nav {display:none;}</style>'; echo 'testtest'; }} }); This does work: add_action('init', function(){ if( !current_user_can('edit_posts') || !is_user_logged_in() ){ echo '<style>.single.single-course.c6 #item-nav {display:none;}</style>'; echo 'testtest'; } });
    #216760
    maximus
    Member
    This reply has been marked as private.
    #218358
    [email protected]
    Participant
    This reply has been marked as private.
    #218623
    Ava
    Member
    Hi You can hide the home tab from custom css code only. To hide please paste the below code in Wp-admin > appearance > customizer > custom css > publish .single-course #home{display:none;}  
    #218942
    [email protected]
    Participant
    Hello, but I only wan't to hide for students. Not for admin and moderator.
    #219089
    Ava
    Member
    Okay, please remove the previous code from the customizer I have shared in above reply if you have added. Now please paste the below custom code in Wp-admin > Plugins > plugins editor > customizer.php > save changes add_action('wp_footer',function (){
       global $post;
       if($post->post_type == 'course'){
           if(!is_user_logged_in() || (is_user_logged_in() && !current_user_can('edit_posts'))){       ?>
           <style>     .single-course #home{display:none;}
           </style>
           <?php
           }
       }
    });  
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Hide Course Page Menu’ is closed to new replies.