<commit_before><?php
/**
 * The Template for displaying all single badges.
 *
 * @package Listify
 */

get_header(); ?>

	<?php // Badge without featured image
	if ( ! has_post_thumbnail() ): ?>
		<!-- Add classes and default badge image url -->
		<div style="background-image: url( <?php echo get_stylesheet_directory_uri() . '/images/default-badge.png'; ?>);" class="page-cover page-cover--large has-image badge-image">
	<?php //Badge with normal featured image (original code)
	else: ?>
		<div 
			<?php
			echo apply_filters(
				'listify_cover', 'page-cover page-cover--large badge-image', array( // WPCS: XSS ok.
					'size' => 'full',
				)
			);
			?>
		>
	<?php endif; ?>
	
		<h1 class="page-title cover-wrapper" style="color: white;">
		<?php
		the_post();
		the_title();
		rewind_posts();
?>
</h1>
	</div>

	<div id="primary" class="container single-badge-content">
		<div class="row content-area">

			<?php if ( 'left' === esc_attr( listify_theme_mod( 'content-sidebar-position', 'right' ) ) ) : ?>
				<?php get_sidebar(); ?>
			<?php endif; ?>

			<main id="main" class="site-main col-xs-12 
				<?php
				if ( 'none' !== esc_attr( listify_theme_mod( 'content-sidebar-position', 'right' ) ) && is_active_sidebar( 'widget-area-sidebar-1' ) ) :
				?>
				col-sm-7 col-md-8<?php endif; ?>" role="main">

				<?php
				while ( have_posts() ) :
					the_post();
					
					if ( listify_has_integration( 'woocommerce' ) ) :
						wc_print_notices();
					endif;
					?>

					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

						<?php if ( ! is_singular() ) : ?>

						<header <?php echo apply_filters( 'listify_cover', 'entry-header entry-cover' ); ?>>
							<div class="cover-wrapper">
								<h2 class="entry-title entry-title--in-cover"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
							</div>
						</header><!-- .entry-header -->

						<?php endif; ?>

						<div class="content-box-inner">
							<!-- Description of the badge (Certification, Target, Fields of Education and Level). -->
							<div class="badge-description">
								<?php 
									if( get_post_meta($post->ID, '_certification', true) == 'certified' ):
										echo "<b>Certification Type: </b>Certified<br>";
									else:
										echo "<b>Certification Type: </b>Not Certified<br>";
									endif;

									if( get_post_meta($post->ID, '_target', true) == 'teacher' ):
										echo "<b>Target: </b>Teacher<br>";
									else:
										echo "<b>Target: </b>Student<br>";
									endif;
									
									echo "<b>Field(s) of Education: </b>" . get_CPT_terms($post->ID, 'field_of_education' ) . "<br>";
									echo "<b>Level(s): </b>" . get_CPT_terms($post->ID, 'level' ) . "<br>";
								?>
							</div>

							<!-- Badge's description -->
							<?php if ( is_singular() ) : ?>
								<div class="entry-content">
									<?php the_content(); ?>
								</div><commit_msg>Research on single badge page<commit_after><?php
/**
 * The Template for displaying all single badges.
 *
 * @package Listify
 */

get_header(); ?>

	<?php // Badge without featured image
	if ( ! has_post_thumbnail() ): ?>
		<!-- Add classes and default badge image url -->
		<div style="background-image: url( <?php echo get_stylesheet_directory_uri() . '/images/default-badge.png'; ?>);" class="page-cover page-cover--large has-image badge-image">
	<?php //Badge with normal featured image (original code)
	else: ?>
		<div 
			<?php
			echo apply_filters(
				'listify_cover', 'page-cover page-cover--large badge-image', array( // WPCS: XSS ok.
					'size' => 'full',
				)
			);
			?>
		>
	<?php endif; ?>
	
		<h1 class="page-title cover-wrapper" style="color: white;">
		<?php
		the_post();
		the_title();
		rewind_posts();
?>
</h1>
	</div>

	<div id="primary" class="container single-badge-content">
		<div class="row content-area">

			<?php if ( 'left' === esc_attr( listify_theme_mod( 'content-sidebar-position', 'right' ) ) ) : ?>
				<?php get_sidebar(); ?>
			<?php endif; ?>

			<main id="main" class="site-main col-xs-12 
				<?php
				if ( 'none' !== esc_attr( listify_theme_mod( 'content-sidebar-position', 'right' ) ) && is_active_sidebar( 'widget-area-sidebar-1' ) ) :
				?>
				col-sm-7 col-md-8<?php endif; ?>" role="main">

				<?php
				while ( have_posts() ) :
					the_post();
					
					if ( listify_has_integration( 'woocommerce' ) ) :
						wc_print_notices();
					endif;
					?>

					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

						<?php if ( ! is_singular() ) : ?>

						<header <?php echo apply_filters( 'listify_cover', 'entry-header entry-cover' ); ?>>
							<div class="cover-wrapper">
								<h2 class="entry-title entry-title--in-cover"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
							</div>
						</header><!-- .entry-header -->

						<?php endif; ?>

						<div class="content-box-inner">
							<!-- Description of the badge (Certification, Target, Fields of Education and Level). -->
							<div class="badge-description">
								<?php 
									if( get_post_meta($post->ID, '_certification', true) == 'certified' ): ?>
										<b>Certification Type: </b><a href="<?php echo get_permalink( get_page_by_path( 'open-badge' ) ) . "?_sfm__certification=certified" ?>">Certified</a><br>
									<?php else: ?>
										<b>Certification Type: </b><a href="<?php echo get_permalink( get_page_by_path( 'open-badge' ) ) . "?_sfm__certification=not_certified" ?>">Not Certified</a><br>
									<?php endif;

									if( get_post_meta($post->ID, '_target', true) == 'teacher' ): ?>
										<b>Target: </b><a href="<?php echo get_permalink( get_page_by_path( 'open-badge' ) ) . "?_sfm__target=teacher" ?>">Teacher</a><br>
									<?php else: ?>
										<b>Target: </b><a href="<?php echo get_permalink( get_page_by_path( 'open-badge' ) ) . "?_sfm__target=student" ?>">Student</a><br>
									<?php endif;
									
									echo "<b>Field(s) of Education: </b>" . get_CPT_terms($post->ID, 'field_of_education' ) . "<br>";
									echo "<b>Level(s): </b>" . get_CPT_terms($post->ID, 'level' ) . "<br>";
								?>
							</div>

							<!-- Badge's description -->
							<?php if ( is_singular() ) : ?>
								<div class="entry-content">
									<?php the_content(); ?>
								</div>
{'fraction_non_alphanumeric': 0.20025268477574226, 'fraction_numerical': 0.002842703727100442, 'mean_word_length': 2.8312159709618876, 'pattern_counts': {'":': 0, '<': 153, '<?xml version=': 0, '>': 163, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5661051', 'n_tokens_mistral': 2801, 'n_tokens_neox': 2146, 'n_words': 463}