%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/1857783/root/home/maraton/maraton.eco-n-tech.co.uk/wp-content/themes/maraton/
Upload File :
Create Path :
Current File : //proc/1857783/root/home/maraton/maraton.eco-n-tech.co.uk/wp-content/themes/maraton/single.php

<?php
/**
 * The Template for displaying all single posts
 *
 * Methods for TimberHelper can be found in the /lib sub-directory
 *
 * @package  WordPress
 * @subpackage  Timber
 * @since    Timber 0.1
 */

$context         = Timber::context();
$timber_post     = Timber::get_post();
$context['post'] = $timber_post;

// Related posts
if($timber_post->post_type) {
	$context['related'] = Timber::get_posts(array(
		'numberposts' => 4,
		'post_type'   => $timber_post->post_type,
		'orderby'     => 'date',
		'order'       => 'DESC',
		'post__not_in' 	  => array($timber_post->ID)
	));
}

// Check if post type is biblioteket
if ($timber_post->post_type == 'biblioteket') {
    $context['date_format'] = get_field('biblioteket_date_format', 'options');
}

// Check if post type is faq
if ($timber_post->post_type == 'faq') {
    $context['archive_link'] = get_post_type_archive_link('faq');
}

if ( post_password_required( $timber_post->ID ) ) {
	Timber::render( 'single-password.twig', $context );
} else {
	Timber::render( array( 'single-' . $timber_post->ID . '.twig', 'single-' . $timber_post->post_type . '.twig', 'single-' . $timber_post->slug . '.twig', 'single.twig' ), $context );
}

Zerion Mini Shell 1.0