From 9ada146e1f961b1b62dc9129e756ceee66282ad2 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 9 Jan 2024 22:31:31 +0100 Subject: [PATCH] wait #6564 --- .../physioassist/src/Elementor/Widgets/FluxPostCarousel.php | 3 ++- wp-content/themes/physioassist/resources/functions.php | 6 +++++- .../physioassist/resources/views/partials/post.blade.php | 2 +- .../resources/views/widgets/flux-post-carousel.blade.php | 5 +++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/FluxPostCarousel.php b/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/FluxPostCarousel.php index 0e374b40..b75eff20 100644 --- a/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/FluxPostCarousel.php +++ b/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/FluxPostCarousel.php @@ -117,7 +117,8 @@ class FluxPostCarousel extends Widget_Base { ]); $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 = [ diff --git a/wp-content/themes/physioassist/resources/functions.php b/wp-content/themes/physioassist/resources/functions.php index 509e632f..1dae87d7 100644 --- a/wp-content/themes/physioassist/resources/functions.php +++ b/wp-content/themes/physioassist/resources/functions.php @@ -115,13 +115,17 @@ function flux_posts() $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(); } diff --git a/wp-content/themes/physioassist/resources/views/partials/post.blade.php b/wp-content/themes/physioassist/resources/views/partials/post.blade.php index e5933ca6..a005a061 100644 --- a/wp-content/themes/physioassist/resources/views/partials/post.blade.php +++ b/wp-content/themes/physioassist/resources/views/partials/post.blade.php @@ -7,6 +7,6 @@ $format = $current_language === "en" ? "Y/m" : "m/Y";

{!! date($format, strtotime($item->post_date)) !!}

{{ $item->post_title }}

{{ $item->subtitle }}

- @svg('arrow') {{ __('Read more', 'sage') }} + @svg('arrow') {{ __('Read more', 'sage') }} {{-- .flux-post-carousel-item-content --}} {{-- .flux-post-carousel-item --}} diff --git a/wp-content/themes/physioassist/resources/views/widgets/flux-post-carousel.blade.php b/wp-content/themes/physioassist/resources/views/widgets/flux-post-carousel.blade.php index b1ab8e98..df9c6683 100644 --- a/wp-content/themes/physioassist/resources/views/widgets/flux-post-carousel.blade.php +++ b/wp-content/themes/physioassist/resources/views/widgets/flux-post-carousel.blade.php @@ -57,9 +57,14 @@
@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))
@if (!empty($cta['cta_text'])) -- 2.39.5