CoursePress customization

How would it be possible to customize CoursePres and specifically:
Customize the /courses/ page , some written information at the top of the course listing page. Like "To select a course, log into the site. "

  • Panos

    Hey there Stephen ,

    In order to display a message on the top of the courses list page, you can add the following in your functions.php file:

    add_filter( 'coursepress_template_course_list_box', function( $template, $course_id, $a ){
    
    	if( ! is_user_logged_in() ){
    
    		$custom_link = '<div class="wpmudev-cp-login-msg"><a href="http://4path.com/student-login/">To select a course, log into the site.</a></div>';
    
    		$template = $custom_link . $template;
    
    	}
    
        return $template;
    
    }, 10, 3 );

    If you would like to display only that message and hide the courses list you use the following instead:

    add_filter( 'coursepress_template_course_list_box', function( $template, $course_id, $a ){
    
    	if( ! is_user_logged_in() ){
    
    		$custom_link = '<div class="wpmudev-cp-login-msg"><a href="http://4path.com/student-login/">To select a course, log into the site.</a></div>';
    
    		return $custom_link;
    
    	}
    
        return $template;
    
    }, 10, 3 );

    Note:
    In both snippets above it will display message only if visitor isn't logged in based on the content of the message you shared.

    Please let me know if this helps achieve what you want or if you need something different :slight_smile:

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.