<?php
/**
 * Template part for displaying page content in page.php
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Restaurant
 * @since WP Restaurant 1.0
 */

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<header class="entry-header">
		
		<div class="menu-title-header">
		<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
		 </div>
		 <div class="clear"></div>

	</header><!-- .entry-header -->
	<?php
	if ( is_singular( 'page' ) ) {
		$restaurant_single_post_image_align = wp_restaurant_option( 'single-page-image-position', 'no-sidebar' );

		$restaurant_single_post_image_align_meta = get_post_meta( $post->ID, 'restaurant-single-post-image-align', true );
		if( false != $restaurant_single_post_image_align_meta ){
			$restaurant_single_post_image_align = $restaurant_single_post_image_align_meta;
		}
		$post_image_size = false;
		if( 'full' == $restaurant_single_post_image_align ){
			$post_image_size = 'wp-restaurant-post-image-full';
		} else if( 'left' == $restaurant_single_post_image_align || 'right' == $restaurant_single_post_image_align ) {
			$post_image_size = 'wp-restaurant-post-image-side';
		} 
		
		if ( has_post_thumbnail() && 'none' !=  $restaurant_single_post_image_align ):
			?>
			<figure class="image-<?php echo $restaurant_single_post_image_align ;?>">
				<?php the_post_thumbnail( $post_image_size ); ?>
			</figure>
			<?php
		endif;
	}
		?>

	<div class="entry-content">
		<?php
			the_content();

			wp_link_pages( array(
				'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wp-restaurant' ),
				'after'  => '</div>',
			) );
		?>
	</div><!-- .entry-content -->

	<?php if ( get_edit_post_link() ) : ?>
		<footer class="entry-footer">
			<?php
				edit_post_link(
					sprintf(
						/* translators: %s: Name of current post */
						esc_html__( 'Edit %s', 'wp-restaurant' ),
						the_title( '<span class="screen-reader-text">"', '"</span>', false )
					),
					'<span class="edit-link">',
					'</span>'
				);
			?>
		</footer><!-- .entry-footer -->
	<?php endif; ?>
</article><!-- #post-## -->
