]);
$categoriesId = array_map(function($n){ return $n->term_id; },$categories);
- $items = get_posts(['category__in'=>$categoriesId]);
+ $args = ['category__in'=>$categoriesId,'posts_per_page'=> -1];
+ $items = get_posts($args);
$title = $this->get_settings('title');
$cta = [
$posts = get_posts([
'posts_per_page' => -1,
'category__in' => !empty($catId) ? [$catId] : $categoriesId,
- 'order' => 'desc',
+ 'order' => 'desc'
]);
$current_language = apply_filters( 'wpml_current_language', NULL );
foreach ($posts as $item) {
+ $translated_id = apply_filters('wpml_object_id', $item->ID, 'post');
+ $item = get_post($translated_id);
echo template('partials/post', compact('item'));
}
+ remove_filter('wpml_current_language', $current_language);
+
die();
}
<p class="flux-post-carousel-date">{!! date($format, strtotime($item->post_date)) !!}</p>
<h3 class="flux-post-carousel-title">{{ $item->post_title }}</h3>
<p class="flux-post-carousel-subtitle">{{ $item->subtitle }}</p>
- <a href="{{ get_the_permalink($item->id) }}" class="arrow-link">@svg('arrow') {{ __('Read more', 'sage') }}</a>
+ <a href="{{ get_the_permalink($item->ID) }}" class="arrow-link">@svg('arrow') {{ __('Read more', 'sage') }}</a>
</div> {{-- .flux-post-carousel-item-content --}}
</div> {{-- .flux-post-carousel-item --}}
<div class="flux-post-carousel elementor-slick-slider" data-slick="{{ $slick }}">
@foreach ($items as $item)
+ @php
+ $translated_id = apply_filters('wpml_object_id', $item->ID, 'post');
+ $item = get_post($translated_id);
+ @endphp
@include('partials.post')
@endforeach
+ @php(remove_filter('wpml_current_language', $current_language))
</div>
<div class="flux-post-carousel-download">
@if (!empty($cta['cta_text']))