blue cercle disabled in my theme

hi my friends
i changed my theme,i installed coursepress pro,
i think the blue cercle around the number is disabled in my theme

thanks for all your help

    Adam Czajczyk

    Hello moben,

    I hope you're well today and thank you for your question!

    The "blue circle" is supported out of the box by "CoursePress Pro" theme that's bundled-in with the plugin but other themes may not support it indeed. I checked this to make it work with your current theme you would need to create a custom page template.

    The first step would be to create a basic child-theme of your current theme:

    https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/

    Then you would want to copy "archive.php" file from the parent theme (your current theme) to the child theme folder and rename it to "archive-unit.php". Final step would be to edit that file to replace the default WP loop with custom loop used by CoursePress Pro theme.

    To do this, you would need to make two changes in that file:

    1. replace this code:

    <?php
    /**
     * The template for displaying archive pages.
     *
     * obito https://codex.wordpress.org/Template_Hierarchy
     *
     * @package lontano
     */
    
    get_header(); ?>

    with this one:

    <?php
    /**
     * The units archive template file
     *
     * @package CoursePress
     */
    global $coursepress;
    $course_id = do_shortcode( '[get_parent_course_id]' );
    $course_id = (int) $course_id;
    $progress  = do_shortcode( '[course_progress course_id="' . $course_id . '"]' );
    //redirect to the parent course page if not enrolled
    $coursepress->check_access( $course_id );
    
    get_header(); ?>

    2. replace this code

    <?php
    		if ( have_posts() ) : ?>
    
    			<header class="page-header">
    				<?php
    					the_archive_title( '<h1 class="page-title">', '</h1>' );
    					the_archive_description( '<div class="taxonomy-description">', '</div>' );
    				?>
    			</header><!-- .page-header -->
    
    			<?php
    			/* Start the Loop */
    			while ( have_posts() ) : the_post();
    
    				/*
    				 * Include the Post-Format-specific template for the content.
    				 * If you want to override this in a child theme, then include a file
    				 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    				 */
    				get_template_part( 'template-parts/content', get_post_format() );
    
    			endwhile;
    
    			if ( version_compare( $GLOBALS['wp_version'], '4.1', '<' ) ) :
    				the_posts_navigation();
    			else :
    				the_posts_pagination( array(
    					'prev_text'          => '<i class="fa fa-angle-double-left spaceRight"></i>' . esc_html__( 'Previous', 'lontano' ),
    					'next_text'          => esc_html__( 'Next', 'lontano' ) . '<i class="fa fa-angle-double-right spaceLeft"></i>',
    					'before_page_number' => '<span class="meta-nav screen-reader-text">' . esc_html__( 'Page', 'lontano' ) . ' </span>',
    				) );
    			endif;
    
    		else :
    
    			get_template_part( 'template-parts/content', 'none' );
    
    		endif; ?>

    with this one

    <?php
    	$units = Course::get_units_with_modules( $course_id );
    
    	if ( ! empty( $units ) && count( $units ) > 0 ) {
    
    		foreach ( $units as $unit_id => $unit ) {
    			$post                = $unit['post'];
    			$additional_class    = '';
    			$additional_li_class = '';
    
    			$is_unit_available = Unit::is_unit_available( $unit_id );
    
    			if ( ! $is_unit_available ) {
    				$additional_class    = 'locked-unit';
    				$additional_li_class = 'li-locked-unit';
    			}
    
    			$unit_progress = do_shortcode( '[course_unit_percent course_id="' . $course_id . '" unit_id="' . $unit_id . '" format="true" style="extended"]' );
    
    			?>
    			<li class="<?php echo $additional_li_class; ?>">
    				<div class='<?php echo $additional_class; ?>'></div>
    				<div class="unit-archive-single">
    					<?php echo $unit_progress; ?>
    					<?php echo do_shortcode( '[course_unit_title unit_id="' . $unit_id . '" link="yes" last_page="yes"]' ); ?>
    					<?php echo do_shortcode( '[module_status format="true" course_id="' . $course_id . '" unit_id="' . $unit_id . '"]' ); ?>
    				</div>
    			</li>
    			<?php
    		}
    	} else {
    		?>
    		<h1 class="zero-course-units"><?php _e( "0 units in the course currently. Please check back later." ); ?></h1>
    		<?php
    	}
    
    ?>

    After enabling the child theme the "blue circle" should be there. There may be some additional CSS styling necessary but I think it would be best to first get this to work and then see if that would be required.

    Best regards,
    Adam

    Adam Czajczyk

    Hello moben!

    I'm glad I could help you with this

    As for the missing header. I accessed your site again, visited course and kept clicking "continue learning" and "back" browser button a few time back and forth but I'm still not quite sure what do you mean. Could you elaborate a bit more on this? Screenshots "with" and "without" header would also help.

    I'm sure we can find a solution but I'd just like to make sure first what the issue is

    Thanks for your help!

    Best regards,
    Adam

    Adam Czajczyk

    Hello moben!

    I checked the site again and switched theme for a moment and I can now see what's the issue here.

    I have checked this on my own setup and it turned out that I missed a small part of the template, I'm sorry for this. To fix it, please edit your recently created "archive-unit.php" file and replace this code:

    get_header(); ?>
    
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main" role="main">
    
    		<?php
    	$units = Course::get_units_with_modules( $course_id );

    with this one:

    get_header();
    ?>
    	<div id="primary" class="content-area">
    	<main id="main" class="site-main" role="main">
    	<h1><?php echo get_the_title( $course_id ) ?></h1>
    	<div class="instructors-content">
    		<?php
    		// Flat hyperlinked list of instructors
    		echo do_shortcode( '[course_instructors style="list-flat" link="true" course_id="' . $course_id . '"]' );
    		?>
    	</div>
    
    <?php
    echo do_shortcode( '[course_unit_archive_submenu]' ) . '&nbsp;';
    ?>
    <?php
    if ( 100 == (int) $progress ) {
    	echo sprintf( '<div class="unit-archive-course-complete">%s %s</div>', '<i class="fa fa-check-circle"></i>', __( 'Course Complete', 'cp' ) );
    }
    ?>
    
    	<div class="clearfix"></div>
    	<ul class="units-archive-list">
    	<?php
    	$units = Course::get_units_with_modules( $course_id );

    This should bring back the missing parts: the title of the course, course sub-menu etc.

    Best regards,
    Adam

    Dimitris

    Hey there moben,

    hope you're doing good and don't mind chiming in!

    I just want to point out that the latest addition of Adam's code was to display
    1) the instructor link (mourad benguellil)
    2) the following sub-menu items:
    Units | Notifications | Discussions | Workbook | Course | Details | Certificate

    About the percentage score now, there were an error due to HummingBird Minification module.
    I spent some time on your Minification settings and disabled some scripts from minification.
    Now it seems that there're no errors and the percentage graphic is working again.

    Warm regards,
    Dimitris