@php $latestBlogs = getLatestBlogsWithTranslations(7, ['author', 'media', 'categories'], true); $latestTendingBlogs = getBlogsByMetaData( [ 'is_trending' => 1, ], 4, true, ['author', 'media', 'categories'], )['blogs']; $latestCategories = getBlogCategoriesWithTranslations(['media'], ['contents'], 10); $profileSection = site_configurations('theme2_blog_sidebar_profile_section', true); @endphp @if ($latestBlogs->count() > 0)

{{ __('frontend::translate.Latest Posts') }}

@foreach ($latestBlogs as $key => $blog)
{{ $blog->title }}
{{ $blog->categories->first()->name ?? 'Uncategorized' }}

{{ getCountedWord($blog->title, 70) }}

@if ($blog?->excerpt)

{!! getCountedWord($blog?->excerpt, 110) !!}

@endif
@endforeach
@include('frontend::components.custom-home-pagination', [ 'items' => $latestBlogs, 'sectionId' => 'latest_post', ])
@if (getTranslatedData($profileSection, 'show_sidebar_profile') == 1) @endif

{{ __('frontend::translate.Trending Posts') }}

@foreach ($latestTendingBlogs as $blog)
{{ $blog->title }}

{{ getCountedWord($blog->title, 70) }}

{{ $blog->created_at->format('M d, Y') }}
@endforeach

{{ __('frontend::translate.Categories') }}

    @foreach ($latestCategories as $category)
  • {{ $category->name }} ({{ $category->contents_count }})

  • @endforeach
@endif