ACC SHELL

Path : /srv/www/vhosts/laboserv/wp-content/themes/laboserv2020/
File Upload :
Current File : //srv/www/vhosts/laboserv/wp-content/themes/laboserv2020/page.php

<?php
/**
 * The template for displaying pages
 *
 * @package WordPress
 * @subpackage Laboserv2020
 * @since Laboserv2020 1.0
 */

get_header(); ?>

<div class="ordinary-page">
<div class="breadcrumbs">
	<div class="content">
	<?php
	
	$breadcrumbs_content = '<ul>
<li><a href="'.esc_url( home_url( '/' ) ).'">Hlavní stránka</a></li>';

	$postID = get_the_ID();
	
	$categories = get_the_category( $postID );
	foreach( $categories as $cat )
	{
		$category_name = $cat->name;
		$category_slug = $cat->slug;
		$category_ID = $cat->cat_ID;
		$category_link = get_category_link( $cat );
		$breadcrumbs_content .= '<li><a href="'.$category_link.'">'.ucfirst( $cat->name ).'</a></li>';	
	}
	
	$parents = array();
	$pageID = $postID;
	do {
		$parentID = wp_get_post_parent_id( $pageID );
		if ( $parentID ) {
			$parents[] = array(
				'id' => $parentID,
				'title' => get_the_title( $parentID ), 
				'url' => get_the_permalink( $parentID )
			);			
		}
		$pageID = $parentID;
	} while ( $pageID );
	
	$parents = array_reverse($parents);
	
	foreach( $parents as $parent )
	{
		$breadcrumbs_content .= '<li><a href="'.$parent[ 'url' ].'">'.$parent[ 'title' ].'</a></li>';	
	}	

	$breadcrumbs_content .= '<li>'.get_the_title( $postID ).'</li>
	</ul>';
	
	echo $breadcrumbs_content;
?>
	
	</div><!-- .content END -->
</div><!-- .breadcrumbs END -->

<article class="ordinary">
	<div class="content">
	<header>
		<?php
			echo '<h1>'.get_the_title( $postID ).'</h1>';
			
			$hide_perex = get_field( 'hide_perex', $postID );
			
			if ( ! $hide_perex )
			{
				echo '<p class="excerpt">'.get_the_excerpt( $postID ).'</p>';
			}
		?>
	</header>
	
	<div class="post-content">
		<?php the_content( $postID ); ?>
	</div>
	
	</div><!-- .content -->
</article>

<div class="lower-breadcrumbs">
	<div class="content">
	<?php echo $breadcrumbs_content; ?>
	</div><!-- .content END -->
</div><!-- .lower-breadcrumbs END -->

</div><!-- .ordinary-page END -->

<?php //get_sidebar(); 
get_template_part( 'supfooter' ); ?>
<?php get_footer(); ?>

ACC SHELL 2018