File: /var/www/html/wp-content/themes/polygant_2025/author.php
<?php
/**
* The template for displaying author pages
*
*/
?>
<?php get_header('new'); ?>
<?php
// Set the Current Author Variable
$cur_auth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
$user_id = $cur_auth->ID;
$acf_id = 'user_'.$user_id;
$page_title = get_field( "aut_page_title", $acf_id );
$page_content = get_field( "aut_content", $acf_id );
$posts_list_title = 'Last publications';
$page_image_url = get_field( "aut_image", $acf_id );
$my_home_url = "/";
?>
<section class="pl-post-author hero">
<div class="container">
<div class="pl-bio">
<div class="pl-left">
<h1 class="title"><?php echo $page_title; ?></h1>
<div class="bread">
<p id="breadcrumbs">
<span>
<span><a href="<?php echo $my_home_url; ?>" ><?php the_field('главная_название', 233 );?></a></span> — <span class="breadcrumb_last" aria-current="page"><?php echo $page_title; ?></span>
</span>
</p>
</div>
<div class="pl-right mobile">
<img src="<?php echo $page_image_url; ?>">
</div>
<div class="info">
<?php echo $page_content; ?>
</div>
<div class="list-posts">
<h2><?php echo $posts_list_title; ?></h2>
<?php
$args = array(
'post_type' => array('post', 'cases', 'blog'),
'post_status' => 'publish',
'author' => $user_id,
'posts_per_page' => 18,
'orderby' => 'date',
'order' => 'DESC'
);
$query_posts = new WP_Query($args);
?>
<?php if ( $query_posts->have_posts() ) {
?><ul class="publications-list"><?php
while ( $query_posts->have_posts() ) {
$query_posts->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?></a>
</li>
<?php }
?></ul><?php
}
wp_reset_postdata();
?>
</div>
</div>
<div class="pl-right de">
<img src="<?php echo $page_image_url; ?>">
</div>
</div>
</div>
</section>
<?php
get_footer('new');