ACC SHELL
<?php
/**
* Template Name: Archiv aktualit
*
* Description: Šablona pro zobrazení archivu aktualit
*
* @package WordPress
* @subpackage Laboserv2020
* @since Laboserv2020 1.0
*/
get_header(); ?>
<?php $postID = get_the_ID(); ?>
<div class="ordinary-page">
<div class="breadcrumbs">
<div class="content">
<ul>
<li><a href="<?php echo esc_url( home_url( '/' ) ); ?>">Hlavní stránka</a></li>
<li><?php echo get_the_title( $postID ); ?></li>
</ul>
</div><!-- .content END -->
</div><!-- .breadcrumbs END -->
<article class="news-archive">
<div class="content">
<header>
<?php
echo '<h1>'.get_the_title( $postID ).'</h1>';
?>
</header>
<div class="post-content">
<?php the_content( $postID ); ?>
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'category__not_in' => array( 14 )
);
// Create the new query
$news_posts = new WP_Query( $args );
// vypis produktu
while ( $news_posts->have_posts() )
{
$news_posts->the_post();
global $post;
$postID = $post->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 );
}
echo '<article class="news-post">';
if ( ! strcmp( $category_slug, 'poradna' ) )
{
if ( has_post_thumbnail( $postID ) )
{
echo get_the_post_thumbnail();
}
}
echo '<h1><a href="'.get_the_permalink( $postID ).'">'.get_the_title( $postID ).'</a></h1>';
echo '<p class="excerpt">'.get_the_excerpt( $postID ).'</p>';
$categories = get_the_category( $postID );
//print_r( $categories );
echo '<footer><span class="date">'.get_the_date( 'j. F Y', $postID ).'</span> •';
echo ' <a href="'.$category_link.'" class="category">'.$category_name.'</a>';
echo '</footer>';
echo '</article>';
}
// Previous/next page navigation.
the_posts_pagination(
array(
'prev_text' => __( 'Previous page', 'twentysixteen' ),
'next_text' => __( 'Next page', 'twentysixteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
)
);
?>
</div>
</div><!-- .content -->
</article>
</div><!-- .ordinary-page END -->
<?php //get_sidebar();
get_template_part( 'supfooter' ); ?>
<?php get_footer(); ?>
ACC SHELL 2018