<?php
/**
 * Partial template for displaying the post "Read More" button.
 *
 * @package Blogbuster
 *
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$blogbuster_archive_post_readmore_enable = blogbuster_get_customizer_option_value( 'blogbuster_archive_post_readmore_enable' );

if ( true !== $blogbuster_archive_post_readmore_enable ) {
	return;
}
$archive_read_more_type = blogbuster_get_customizer_option_value( 'blogbuster_archive_read_more_type' );
$archive_post_read_more = blogbuster_get_customizer_option_value( 'blogbuster_archive_post_read_more' );
$archive_read_more_icon = blogbuster_get_customizer_option_value( 'blogbuster_archive_read_more_icon' );

if ( 'icon' == $archive_read_more_type ) {
	$type_class = 'icon';
	$read_more_html = '<i class="fa-solid '. esc_attr( $archive_read_more_icon ) .'"></i>';
} else {
	$type_class = 'text';
	$read_more_html = '<span>'. esc_html( $archive_post_read_more ) .'</span>';
}

?>
<div class="mt-button read-more-button <?php echo esc_attr( $type_class ); ?>">
	<a href="<?php the_permalink(); ?>"><?php echo $read_more_html; ?></a>
</div><!-- .read-more-button -->