Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <?php
- while ( have_posts() ) :
- the_post();
- global $wp_query;
- $postid = $wp_query->post->ID;
- ?>
- <div class="jku-label-wrapper">
- <div><span>Przepis</span></div>
- </div>
- <div class="jku-container">
- <div class="jku-column jku-col-6">
- <div class="jku-col-content">
- <div class="jku-recipe-top">
- <?php
- $video = get_post_meta($postid, 'link_do_filmu', true);
- if ( !empty( $video ) ) {
- echo '<iframe width="560" height="315" src="' . $video . '" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>';
- } elseif ( has_post_thumbnail() ) {
- echo '<img class="jku-recipe-featured-image" src="' . get_the_post_thumbnail_url($postid, 'full') . '" />';
- } else {
- echo '<img class="jku-recipe-featured-image" src="/wp-content/uploads/2019/09/jkuron-placeholder-image00.jpg" />';
- }
- ?>
- <h5 class="jku-post-grid-categories">
- <?php
- $term_list = wp_get_post_terms($postid, 'kategorie-przepisow', array("fields" => "all"));
- foreach($term_list as $term_single) {
- echo '<span><a href="' . esc_url(get_term_link( $term_single )) . '">' . $term_single->name . '</a></span>';
- }
- ?>
- </h5>
- <?php
- the_title( '<h1>', '</h1>' );
- ?>
- </div>
- </div>
- </div>
- <div class="jku-column jku-col-6">
- <div class="jku-col-content">
- </div>
- </div>
- </div>
- <div class="jku-container">
- <div class="jku-column jku-col-9">
- <div class="jku-col-content">
- <div class="jku-post-content-wrapper">
- <?php
- if ( !empty( get_the_content() ) ) {
- the_content();
- } else {
- $skladniki = get_post_meta($postid, 'skladniki', true);
- $sposob = get_post_meta($postid, 'sposob_przyrzadzania', true);
- if ( !empty( $skladniki ) && !empty( $sposob ) ) {
- echo '<h3>Składniki</h3>';
- echo $skladniki;
- echo '<h3>Sposób przyrządzania</h3>';
- echo $sposob;
- }
- wp_reset_query();
- }
- the_post_navigation(
- array(
- 'next_text' => '<span class="meta-nav" aria-hidden="true">Kolejny przepis</span>',
- 'prev_text' => '<span class="meta-nav" aria-hidden="true">Poprzedni przepis</span>'
- )
- );
- ?>
- </div>
- <?php
- $term_list = wp_get_post_terms($post->ID, 'tagi-przepisow', array("fields" => "all"));
- if ( !empty( $term_list ) ) { ?>
- <div class="jku-recipe-tags-wrapper">
- <h4>Tagi:</h4>
- <ul class="jku-categories-cloud-wrapper">
- <?php
- foreach($term_list as $term_single) {
- echo '<li><a href="' . esc_url(get_term_link( $term_single )) . '">' . $term_single->name . '</a></li>';
- }
- ?>
- </ul>
- </div>
- <?php } ?>
- <div class="jku-recipe-share-wrapper">
- <h4>Udostępnij!</h4>
- <?php
- echo do_shortcode( '[addtoany]' );
- ?>
- </div>
- <?php
- // If comments are open or we have at least one comment, load up the comment template.
- if ( comments_open() || get_comments_number() ) {
- comments_template();
- }
- ?>
- </div>
- </div>
- <div class="jku-column jku-col-3">
- <div class="jku-col-content">
- <div class="google__adsense">
- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
- <ins class="adsbygoogle"
- style="display:block"
- data-ad-client="ca-pub-6608365990982293"
- data-ad-slot="9478179590"
- data-ad-format="auto"></ins>
- <script>
- (adsbygoogle = window.adsbygoogle || []).push({});
- </script>
- </div>
- </div>
- </div>
- </div>
- <?php
- endwhile;
- ?>
- </div>
- </article>
- <section class="jku-post-grid-wrapper jku-similar-posts-wrapper">
- <div class="jku-label-wrapper">
- <div><span>Sprawdź również</span></div>
- </div>
- <div class="jku-container">
- <div class="jku-column jku-col-12">
- <div class="jku-col-content">
- <?php
- $args = array(
- 'post_type' => 'przepisy',
- 'orderby' => 'rand',
- 'posts_per_page' => '4',
- 'meta_query' => array(
- array(
- 'key' => '_thumbnail_id',
- 'compare' => 'EXISTS'
- )
- )
- );
- $testimonials = new WP_Query($args);
- ?>
- <div class="jku-post-grid-items-wrapper">
- <?php
- while ($testimonials->have_posts()) : $testimonials->the_post();
- // The post
- ?>
- <div class="jku-post-grid-item">
- <?php if ( has_post_thumbnail() ) { ?>
- <a class="jku-post-grid-image" href="<?php the_permalink(); ?>">
- <?php the_post_thumbnail(); ?>
- <?php } else { ?>
- <a class="jku-image-placeholder" href="<?php the_permalink(); ?>">
- <?php }
- if ( has_term( 'wideo', 'kategorie-przepisow' ) ) {
- echo '<img class="jku-video-post-icon" src="/wp-content/themes/jakub-kuron/svg/jkuron-icon-video0.svg" /></img>';
- }
- echo '</a>';
- ?>
- <h5 class="jku-post-grid-categories">
- <?php
- $term_list = wp_get_post_terms($post->ID, 'kategorie-przepisow', array("fields" => "all"));
- foreach($term_list as $term_single) {
- echo '<span><a href="' . esc_url(get_term_link( $term_single )) . '">' . $term_single->name . '</a></span>';
- }
- ?>
- </h5>
- <a class="jku-post-grid-title" href="<?php the_permalink(); ?>"><h3><?php echo get_the_title(); ?></h3></a>
- </div>
- <?php
- endwhile;
- ?>
- </div>
- <?php
- wp_reset_postdata();
- ?>
- </div>
- </div>
- </div>
- </section>
- <?php get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement