<?php
/**
 * Changelog
 */

$zincy_lite = wp_get_theme( 'zincy-lite' );
?>
<div class="featured-section changelog">
<?php
	WP_Filesystem();
	global $wp_filesystem;
	$zincy_lite_changelog       = $wp_filesystem->get_contents( get_template_directory() . '/readme.txt' );
	$changelog_start = strpos($zincy_lite_changelog,'== Changelog ==');
	$zincy_lite_changelog_before = substr($zincy_lite_changelog,0,($changelog_start+18));
	$zincy_lite_changelog = str_replace($zincy_lite_changelog_before,'',$zincy_lite_changelog);
	$zincy_lite_changelog_lines = explode( PHP_EOL, $zincy_lite_changelog );
	foreach ( $zincy_lite_changelog_lines as $zincy_lite_changelog_line ) {
		if ( substr( $zincy_lite_changelog_line, 0, 7 ) === "Version" ) {
			echo '<h4>' . substr( $zincy_lite_changelog_line,0, 14 ) . '</h4>';
		} else {
			echo esc_html( $zincy_lite_changelog_line ), '<br/>';
		}
	}
	echo '<hr />';
	?>
</div>