154 lines
3.5 KiB
PHP
154 lines
3.5 KiB
PHP
<?php get_header();?>
|
|
|
|
|
|
<!-- section -->
|
|
<section>
|
|
|
|
<?php if (have_posts()): while (have_posts()): the_post();?>
|
|
|
|
<!-- article -->
|
|
<article id="post-<?php the_ID();?>" <?php post_class();?>>
|
|
|
|
<!-- post thumbnail -->
|
|
<?php if (has_post_thumbnail()): // Check if Thumbnail exists ?>
|
|
<div class="thumbnailwrapper">
|
|
<?php the_post_thumbnail(); // Fullsize image for the single post ?>
|
|
</div>
|
|
|
|
<?php endif;?>
|
|
<!-- /post thumbnail -->
|
|
|
|
<div class="titlewrapper">
|
|
<div class="metadata">
|
|
<div class="time-cat">
|
|
<?php the_time('Y. m. d.');?> |
|
|
<?php the_category(' | ');?>
|
|
</div>
|
|
<div class="format">
|
|
<?php
|
|
$terms = get_the_terms( $post->ID, 'Format' );
|
|
if ($terms && ! is_wp_error( $terms )) {
|
|
foreach($terms as $term) {
|
|
?>
|
|
<a href="<?php echo esc_url(get_term_link( $term));?>">
|
|
<?php
|
|
echo $term->name;
|
|
echo '</a>';
|
|
}
|
|
} ?>
|
|
</div>
|
|
|
|
</div>
|
|
<h1 class="single-title">
|
|
<?php the_title();?>
|
|
</h1>
|
|
|
|
</div>
|
|
<!-- /post title -->
|
|
|
|
<div class="single-content">
|
|
<hr class="content-wrap content-begin">
|
|
<?php the_content(); // Dynamic Content ?>
|
|
|
|
<?php
|
|
$terms = get_the_terms( $post->ID, 'Writer' );
|
|
if ($terms && ! is_wp_error( $terms )) {
|
|
?>
|
|
<p class="authors">Szerző:
|
|
<?php
|
|
foreach($terms as $term) {
|
|
?>
|
|
<a href="<?php echo esc_url(get_term_link( $term));?>">
|
|
<?php echo $term->name; ?>
|
|
</a>
|
|
<?php
|
|
}
|
|
echo '<p>';
|
|
} ?>
|
|
|
|
<hr class="content-wrap content-end">
|
|
</div>
|
|
|
|
<!-- Related articles -->
|
|
<?php
|
|
$orig_post = $post;
|
|
global $post;
|
|
$categories = get_the_category($post->ID);
|
|
|
|
if ($categories) {
|
|
$category_ids = array();
|
|
|
|
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
|
|
$args=array(
|
|
'category__in' => $category_ids,
|
|
'post__not_in' => array($post->ID),
|
|
'posts_per_page'=> 3, // Number of related posts that will be shown.
|
|
'caller_get_posts'=>1
|
|
);
|
|
|
|
$my_query = new wp_query( $args );
|
|
console_debug($my_query);
|
|
if( $my_query->have_posts() ) {
|
|
?>
|
|
<div id="related_posts"><h3><?php _e('More posts:', 'dis2019');?></h3><ul>
|
|
<?php
|
|
while( $my_query->have_posts() ) {
|
|
$my_query->the_post();
|
|
?>
|
|
|
|
<li>
|
|
<div class="relatedthumb">
|
|
<a href="<? the_permalink();?>" rel="bookmark" title="<?php the_title(); ?>">
|
|
<?php the_post_thumbnail('home-square-thumbnail'); ?>
|
|
</a>
|
|
</div>
|
|
<div class="relatedcontent">
|
|
<h3>
|
|
<a href="<? the_permalink();?>" rel="bookmark" title="<?php the_title(); ?>">
|
|
<?php the_title(); ?>
|
|
</a>
|
|
</h3>
|
|
</div>
|
|
</li>
|
|
<?php
|
|
}
|
|
echo '</ul></div>';
|
|
}
|
|
};
|
|
$post = $orig_post;
|
|
wp_reset_query(); ?>
|
|
|
|
<?php _e('Back to home:', 'dis2019');?>
|
|
<hr class="related-wrap single-end">
|
|
|
|
</article>
|
|
<!-- /article -->
|
|
|
|
|
|
|
|
<?php endwhile;?>
|
|
|
|
|
|
|
|
<?php else: ?>
|
|
|
|
<!-- article -->
|
|
<article>
|
|
|
|
<h1><?php _e('Sorry, nothing to display.', 'dis2019');?></h1>
|
|
|
|
</article>
|
|
<!-- /article -->
|
|
|
|
<?php endif;?>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
<!-- /section -->
|
|
|
|
|
|
|
|
|
|
<?php get_footer();?>
|