<?php 

/**
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */

if (!function_exists('janey_before_content_function')) {

	function janey_before_content_function( $type = "post" ) {
		
		if ( 
			$type == 'post' && 
			( janey_setting('janey_enable_post_author', true) || janey_setting('janey_enable_post_date', true))
		) :
			
			echo '<span class="entry-date">';

			if ( janey_setting('janey_enable_post_author', true) == true ) :

				esc_html_e('Written by ','janey');
				echo get_the_author_posts_link();
			
			endif;

			if ( janey_setting('janey_enable_post_date', true) == true ) :

				esc_html_e(' on ','janey');
				echo get_the_date();
			
			endif;

			echo '</span>';

		endif;
		
		if ( ! janey_is_single() ) {

			do_action('janey_get_title', 'blog' ); 

		} else {

			if ( !janey_is_woocommerce_active('is_cart') ) :
	
				if ( janey_is_single() && !is_page_template() ) :
							 
					do_action('janey_get_title', 'single');
							
				else :
					
					do_action('janey_get_title', 'blog'); 
							 
				endif;
	
			endif;

		}

		if ( $type == 'post' ) :

			echo '<div class="post-meta">';

				if ( janey_setting('janey_enable_post_category', true ) == true ) :
					
					echo '<span class="entry-category">'; 
					the_category(' . '); 
					echo '</span>';
				
				endif;

				echo '<span class="post-icon">'; 

					echo janey_posticon();
				
				echo '</span>';

			echo '</div>';

		endif;

	} 
	
	add_action( 'janey_before_content', 'janey_before_content_function' );

}

?>