@if (is_plugin_active('blog'))
@php
$primarySidebar = Theme::partial('primary-sidebar');
@endphp
@if (is_plugin_active('ads'))
{!! AdsManager::display('before-category-posts', ['style' => 'margin: 10px 0;']) !!}
@endif
@foreach ($categories as $category)
@php
$allRelatedCategoryIds = array_unique(array_merge(app(\Botble\Blog\Repositories\Interfaces\CategoryInterface::class)->getAllRelatedChildrenIds($category), [$category->id]));
$postCategories = app(\Botble\Blog\Repositories\Interfaces\PostInterface::class)->getByCategory($allRelatedCategoryIds, 0, 6);
@endphp
@if (count($postCategories) > 0)
@foreach($postCategories as $postCategory)
@if ($loop->index < 3)
@if ($loop->first)
{{ $postCategory->created_at->translatedFormat('Y-m-d') }}
@if (class_exists($postCategory->author_type) && $postCategory->author)
{{ $postCategory->author->name }}
@endif
@endif
{{ $postCategory->description }}
@endif
@endforeach
@foreach($postCategories as $postCategory)
@if ($loop->index >= 3)
@endif
@endforeach
@endif
@endforeach
@if (is_plugin_active('ads'))
{!! AdsManager::display('after-category-posts', ['style' => 'margin: 10px 0;']) !!}
@endif
{!! $primarySidebar !!}
@endif