File manager - Edit - /var/www/html/wp-content/themes/jiffy/single.php
Back
<?php /** * The template for displaying all single posts * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * * @package WordPress * @subpackage Twenty_Nineteen * @since Twenty Nineteen 1.0 */ get_header(); ?> <div class="page-banner position-relative"> <div class="container"> <div class="col-lg-6"> <div class="content font-24"> <h1><?php echo esc_html( get_field('blog_page_title',101) ); ?></h1> <?php echo get_field('blog_banner_content',101);?> </div> <?php $link = get_field('blog_banner_button',101); if( $link ): $link_url = $link['url']; $link_title = $link['title']; $link_target = $link['target'] ? $link['target'] : '_self'; ?> <a class="btn btn-secondary" href="<?php echo esc_url( $link_url ); ?>" target="<?php echo esc_attr( $link_target ); ?>"><?php echo esc_html( $link_title ); ?></a> <?php endif; ?> </div> </div> <div class="banner-image"> <div class="image-fit d-none d-lg-flex"><div class="overlay"></div> <?php if ( get_field( 'blog_banner_image_desktop',101 ) ): ?> <?php $image = get_field('blog_banner_image_desktop',101); $size = 'full'; if( $image ) { echo wp_get_attachment_image( $image, $size );}?> <?php else:?> <img src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/default-banner.png" alt="<?php the_title();?>"> <?php endif;?> </div> <div class="image-fit d-none d-md-block d-lg-none d-xl-none d-xxl-none"> <?php if ( get_field( 'blog_banner_image_tablate',101 ) ): ?> <?php $image = get_field('blog_banner_image_tablate',101); $size = 'full'; if( $image ) { echo wp_get_attachment_image( $image, $size );}?> <?php else:?> <img src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/default-banner.png" alt="<?php the_title();?>"> <?php endif;?> </div> <div class="image-fit d-block d-md-none"> <?php if ( get_field( 'blog_banner_image_mobile',101 ) ): ?> <?php $image = get_field('blog_banner_image_mobile',101); $size = 'full'; if( $image ) { echo wp_get_attachment_image( $image, $size );}?> <?php else:?> <img src="<?php echo esc_url( get_template_directory_uri() ); ?>/images/default-banner.png" alt="<?php the_title();?>"> <?php endif;?> </div> </div> </div> <div class="section section-grad section-48-100"> <div class="container"> <?php // Start the Loop. while ( have_posts() ) : the_post();?> <div class="blog-deatils section-block title-dark title-600"> <div class="row flex-row-reverse"> <div class="col-md-6 col-lg-7 col-xl-8 full-img img-radius mb-4 mb-lg-5"> <?php if (has_post_thumbnail()) { the_post_thumbnail('full'); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" /> <?php } ?> </div> <div class="col-md-6 col-lg-5 col-xl-4 mb-4 mb-lg-5"> <div class="mb-4 h2-32"> <h2><?php the_title();?></h2> </div> <div class="meta d-flex align-items-center mb-4"> <div class="flex-shrink-0 me-2"><div class="initial d-flex align-items-center justify-content-center"><?php echo get_avatar( get_the_author_meta( 'ID' )); ?></div></div> <div class="flex-grow-1"> <ul> <li><?php the_time( 'F jS, Y' ); ?></li> <li class="author-links"><?php the_author(); ?></li> <li class="cat-links"> <?php $categories = wp_get_post_categories(get_the_ID()); foreach($categories as $category){ echo '<a href="' . get_category_link($category) . '">' . get_cat_name($category) . '</a>'; }?> </li> </ul> </div> </div> <?php echo get_field('intro_content');?> </div> </div> <div class="blog-content title-600 title-dark fw-500"> <?php the_content();?> </div> </div> <?php endwhile; // End the loop. ?> <?php $customTaxonomyTerms = wp_get_object_terms(get_the_ID(), 'category', array('fields' => 'ids')); $blog = new WP_Query(array('showposts' => '2', 'post_type' => 'post', 'post__not_in' => array($post->ID), 'orderby' => 'rand', 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'id', 'terms' => $customTaxonomyTerms ) ))); if ($blog->have_posts()): ?> <div class="section-block"> <div class="title-dark title-600 mb-4"> <h3><?php echo get_field('related_blog_title',101);?></h3> </div> <div class="slider slider-padding BlogSlider ThreeSlider"> <?php while ($blog->have_posts()): $blog->the_post(); ?> <div class="item"> <div class="post-block title-600"> <div class="ratio ratio-4x3"> <a href="<?php the_permalink(); ?>" class="full-img"> <?php if (has_post_thumbnail()) { the_post_thumbnail('full'); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" /> <?php } ?> </a> </div> <div class="content coleql_height"> <ul class="post-meta clearfix"> <li><?php the_time( 'F jS, Y' ); ?></li> <li class="author-links"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><?php the_author(); ?></a></li> <li class="cat-links"> <?php $categories = wp_get_post_categories(get_the_ID()); foreach($categories as $category){ echo '<a href="' . get_category_link($category) . '">' . get_cat_name($category) . '</a>'; }?> </li> </ul> <h4><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title();?></a></h4> </div> </div> </div> <?php endwhile; wp_reset_query();?> </div> </div> <?php endif; ?> </div> </div> <?php get_template_part( 'template-parts/content/content', 'form' ); ?> <?php get_template_part( 'template-parts/content/content', 'cta' ); ?> <?php get_footer();
| ver. 1.4 |
.
| PHP 8.3.10 | Generation time: 0 |
proxy
|
phpinfo
|
Settings