<?php

include_component('blog', 'featured-slider');
include_component('blog', 'themes');
include_component('blog', 'most-read');
include_component('blog', 'news-list');
include_component('blog', 'editorial');
include_component('blog', 'author-banner');

wp_localize_script('blog-archive-posts-ajax-js', 'ajax', array(
    'ajax_url' => admin_url('admin-ajax.php'),
));

$context = Timber::get_context();
$context['blog_title'] = get_field('blog_title', 'options');
$context['blog_desc'] = get_field('blog_desc', 'options');
$context['post_count'] = wp_count_posts()->publish; // Количество опубликованных постов
$context['total_pages'] = ceil($context['post_count'] / get_option('posts_per_page')); // Общее количество страниц

Timber::render('blog/blog-archive.twig', $context);
