<?php
/**
 * Item Title
 *
 * This template can be overridden by copying it to yourtheme/smart-post-show-pro/templates/item/title.php
 *
 * @package    Smart_Post_Show_Pro
 * @subpackage Smart_Post_Show_Pro/public
 */


if ( 'accordion_layout' === $layout ) {
	?>
<<?php echo esc_attr( $post_title_tag ); ?> class="pcp-collapse-header">
	<?php printf( '<a href="%1$s">%2$s</a>', esc_url( get_the_permalink( $post ) ), wp_kses( trim( $pcp_post_title ), $allowed_html_tags ) ); ?>
</<?php echo esc_attr( $post_title_tag ); ?>>
	<?php
} else {
	require SP_PCP_Functions::pcp_locate_template( 'item/product-category-name.php' );
		?>
	<<?php echo esc_attr( $post_title_tag ); ?> class="sp-pcp-title">

		<?php if ( 'popup' === $pcp_page_link_type ) { ?>
			<?php printf( '<a class="popup-modal" href="%1$s" %3$s>%2$s</a>', esc_url( get_the_permalink( $post ) ), wp_kses( trim( $pcp_post_title ), $allowed_html_tags ), esc_attr( $pcp_link_rel_text ) ); ?>
		<?php } elseif ( 'none' === $pcp_page_link_type ) { ?>
				<?php printf( '<a class="pcp-title-link-none" %2$s href="#">%1$s</a>', wp_kses( trim( $pcp_post_title ), $allowed_html_tags ), esc_attr( $pcp_link_rel_text ) ); ?>
		<?php } else { ?>
			<?php printf( '<a href="%1$s" %3$s target="%4$s">%2$s</a>', esc_url( get_the_permalink( $post ) ), wp_kses( trim( $pcp_post_title ), $allowed_html_tags ), esc_attr( $pcp_link_rel_text ), esc_attr( $pcp_link_target ) ); ?>
		<?php } ?>

	</<?php echo esc_attr( $post_title_tag ); ?>>

		<?php
}
