| Server IP : 77.50.203.18 / Your IP : 192.168.0.10 Web Server : Apache/2.4.62 (CentOS Stream) OpenSSL/3.5.7 mpm-itk/2.4.7-04 PHP/8.4.23 System : Linux web2 5.14.0-722.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 6 09:07:51 UTC 2026 x86_64 User : warsnews.ru ( 1001) PHP Version : 8.4.23 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/ifwar.ru/www/wp-content/themes/youvideo/ |
Upload File : |
<?php
/**
* The template for displaying all single posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package youvideo
*/
get_header();
?>
<div class="single-wrap clear">
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'single' );
endwhile; // End of the loop.
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .single-wrap -->
<?php
if ( is_single() ) {
?>
<?php
// Get the taxonomy terms of the current page for the specified taxonomy.
$terms = wp_get_post_terms( get_the_ID(), 'category', array( 'fields' => 'ids' ) );
// Bail if the term empty.
if ( empty( $terms ) ) {
return;
}
$query = array(
'post__not_in' => array( get_the_ID() ),
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $terms,
'operator' => 'IN'
)
),
'posts_per_page' => 12,
'post_type' => 'post',
);
// Allow dev to filter the query.
$args = apply_filters( 'youvideo_related_posts_args', $query );
// The post query
$related = new WP_Query( $args );
if ( $related->have_posts() ) : ?>
<div class="post-bottom-related clear">
<h3 class="related-title"><?php echo esc_html('You May Also Like', 'youvideo'); ?></h3>
<div class="content-loop clear">
<?php while ( $related->have_posts() ) : $related->the_post(); ?>
<?php get_template_part('template-parts/content', 'loop'); ?>
<?php endwhile; ?>
</div><!-- .related-loop -->
</div><!-- .post-bottom-related -->
<?php
endif;
// Restore original Post Data.
wp_reset_postdata();
?>
<?php
}
?>
<?php
while ( have_posts() ) : the_post();
// If comments are open or we have at least one comment, load up the comment template.
if ( ( comments_open() || get_comments_number() ) && is_singular('post') ) :
comments_template();
endif;
endwhile; // End of the loop.
?>
<?php get_footer(); ?>