Commit b1a48623 authored by Petr Balga's avatar Petr Balga

Deleted not needed files.

parent 4ff42a7d
<?php
/**
* The template for displaying news page
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Creepy
* @subpackage Creepy Theme
* @since Creepy 1.0
*/
get_header();
?>
<main class="global-page global-bottom">
<div class="grid-container">
<h1 class="underline"><?php echo single_post_title(); ?></h1>
<p class="perex"><?php echo the_field('acf_novinky_text_pod_nadpisem', 93); ?></p>
<div class="news-list">
<div class="grid-x grid-margin-x">
<div class="cell medium-8">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array( 'post_type' => 'post', 'paged' => $paged, 'cat' => '-10');
$wp_query = new WP_Query($args);
while ( have_posts() ) : the_post(); ?>
<?php $zkracenyObsah = substr(get_the_excerpt(), 0, strpos(wordwrap(get_the_excerpt(), 110), "\n")); ?>
<article><a class="basic" href="<?php echo get_the_permalink(); ?>">
<div class="grid-x">
<?php if (empty(get_the_post_thumbnail_url($post->ID))){ ?>
<div class="cell medium-5 image"><img src="<?php echo get_template_directory_uri(); ?>/assets/home/1.jpg" alt="Neznámý obrázek"></div>
<?php } else { ?>
<div class="cell medium-5 image"><img src="<?php echo get_the_post_thumbnail_url($post->ID) ?>" alt="<?php echo get_post_meta(chc_get_image_id(get_the_post_thumbnail_url($post->ID)), '_wp_attachment_image_alt', TRUE); ?>"></div>
<?php } ?>
<div class="cell medium-7 text">
<div class="inner">
<h2><?php echo the_title(); ?></h2>
<p><?php echo $zkracenyObsah . "..."; ?></p>
<div class="bottom"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/clock.svg" alt="Hodiny" width="20">
<time datetime="<?php echo get_the_date('Y-m-d'); ?>"><?php echo get_the_date('d.m.Y'); ?></time>
</div>
</div>
</div>
</div></a></article>
<?php endwhile; ?>
</div>
<div class="cell medium-4">
<aside>
<div class="docs">
<h3>Důležité dokumenty</h3>
<?php if(!empty(get_theme_mod('chc-handful-callout-media-1'))) { ?> <div class="item"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/doc.svg" alt="Ikonka dokumentu"><a href="<?php echo wp_get_attachment_url(get_theme_mod('chc-handful-callout-media-1')); ?>"><?php echo get_the_title(get_theme_mod('chc-handful-callout-media-1')); ?></a></div> <?php } ?>
<?php if(!empty(get_theme_mod('chc-handful-callout-media-2'))) { ?> <div class="item"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/doc.svg" alt="Ikonka dokumentu"><a href="<?php echo wp_get_attachment_url(get_theme_mod('chc-handful-callout-media-2')); ?>"><?php echo get_the_title(get_theme_mod('chc-handful-callout-media-2')); ?></a></div> <?php } ?>
<?php if(!empty(get_theme_mod('chc-handful-callout-media-3'))) { ?> <div class="item"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/doc.svg" alt="Ikonka dokumentu"><a href="<?php echo wp_get_attachment_url(get_theme_mod('chc-handful-callout-media-3')); ?>"><?php echo get_the_title(get_theme_mod('chc-handful-callout-media-3')); ?></a></div> <?php } ?>
<?php if(!empty(get_theme_mod('chc-handful-callout-media-4'))) { ?> <div class="item"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/doc.svg" alt="Ikonka dokumentu"><a href="<?php echo wp_get_attachment_url(get_theme_mod('chc-handful-callout-media-4')); ?>"><?php echo get_the_title(get_theme_mod('chc-handful-callout-media-4')); ?></a></div> <?php } ?>
<?php if(!empty(get_theme_mod('chc-handful-callout-media-5'))) { ?> <div class="item"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/doc.svg" alt="Ikonka dokumentu"><a href="<?php echo wp_get_attachment_url(get_theme_mod('chc-handful-callout-media-5')); ?>"><?php echo get_the_title(get_theme_mod('chc-handful-callout-media-5')); ?></a></div> <?php } ?>
<?php if(!empty(get_theme_mod('chc-handful-callout-media-6'))) { ?> <div class="item"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/doc.svg" alt="Ikonka dokumentu"><a href="<?php echo wp_get_attachment_url(get_theme_mod('chc-handful-callout-media-6')); ?>"><?php echo get_the_title(get_theme_mod('chc-handful-callout-media-6')); ?></a></div> <?php } ?>
<?php if(!empty(get_theme_mod('chc-handful-callout-media-7'))) { ?> <div class="item"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/doc.svg" alt="Ikonka dokumentu"><a href="<?php echo wp_get_attachment_url(get_theme_mod('chc-handful-callout-media-7')); ?>"><?php echo get_the_title(get_theme_mod('chc-handful-callout-media-7')); ?></a></div> <?php } ?>
<?php if(!empty(get_theme_mod('chc-handful-callout-media-8'))) { ?> <div class="item"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/doc.svg" alt="Ikonka dokumentu"><a href="<?php echo wp_get_attachment_url(get_theme_mod('chc-handful-callout-media-8')); ?>"><?php echo get_the_title(get_theme_mod('chc-handful-callout-media-8')); ?></a></div> <?php } ?>
</div>
</aside>
</div>
</div>
</div>
<div class="pagination">
<ul>
<?php echo str_replace('<span class="page-numbers dots"', '<p class="page-numbers dots"', paginate_links(array('type' => 'list', 'prev_next' => false))); ?>
</ul>
</div>
</div>
</main>
<?php get_footer(); ?>
\ No newline at end of file
<?php get_header(); ?>
<?php
global $wp_query;
$wp_query->the_post();
$currentCategory = get_the_category()[0]->term_id;
?>
<main class="global-page global-bottom">
<div class="grid-container">
<h1 class="underline"><?php echo the_title(); ?></h1>
<div class="basic-page">
<div class="grid-x grid-margin-x">
<div class="cell medium-4">
<button class="button aside-button" data-open-elem="page-aside">Kategorie: <?php echo get_the_category()[0]->name; ?></button>
<aside class="page-aside" id="page-aside">
<button class="close" data-open-elem="page-aside"><img src="<?php echo get_template_directory_uri(); ?>/assets/icons/cross.svg" alt="Křížek"></button>
<ul class="aside-menu">
<li><a class="active" href="#"><?php the_title(); ?></a></li>
<?php
$args = array(
'numberposts' => 8,
'offset' => 0,
'category' => $currentCategory,
'orderby' => 'post_date',
'order' => 'DESC',
'include' => '',
'exclude' => get_the_ID(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'post_status' => 'publish',
'suppress_filters' => true
);
$recent_posts = wp_get_recent_posts( $args, ARRAY_A );
foreach ($recent_posts as $postname) { ?>
<li><a href="<?php echo get_the_permalink($postname['ID']) ?>"><?php echo get_the_title($postname['ID']) ?></a></li>
<?php } ?>
</ul>
</aside>
</div>
<div class="cell medium-8">
<?php echo the_content(); ?>
<div class="files grid-x">
<?php
foreach (get_attached_media('application') as $file){ ?>
<?php $filetype = $file->post_mime_type; ?>
<div class="cell item">
<div class="grid-x grid-margin-x">
<div class="cell shrink">
<div class="round">
<?php
if(strpos($filetype, 'pdf')) {echo 'PDF';}
else if(strpos($filetype, 'text') !== false) {echo 'TXT';}
else if(strpos($filetype, 'rar') !== false) {echo 'RAR';}
else if(strpos($filetype, 'zip') !== false) {echo 'ZIP';}
else if(strpos($filetype, 'mp4') !== false) {echo 'MP4';}
else if(strpos($filetype, 'png') !== false) {echo 'PNG';}
else if(strpos($filetype, 'mpeg') !== false) {echo 'MPEG';}
else if(strpos($filetype, 'mp3') !== false) {echo 'MP3';}
else if(strpos($filetype, 'doc') !== false) {echo 'doc';}
else if(strpos($filetype, 'wav') !== false) {echo 'WAV';}
else if(strpos($filetype, 'gif') !== false) {echo 'GIF';}
else if(strpos($filetype, 'psd') !== false) {echo 'PSD';}
else if(strpos($filetype, 'svg') !== false) {echo 'SVG';}
else if(strpos($filetype, 'pptx') !== false) {echo 'PPTX';}
?>
</div>
</div>
<div class="cell auto"><span><?php echo $file->post_title; ?></span></div>
<div class="cell shrink"><a class="button primary" href="<?php echo $file->guid; ?>"><span>Stáhnout</span></a></div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</main>
<?php get_footer(); ?>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment