]> _ Git - physioassist-wordpress.git/commitdiff
wait #6564
authorsoufiane <soufiane@cubedesigners.com>
Tue, 9 Jan 2024 21:31:31 +0000 (22:31 +0100)
committersoufiane <soufiane@cubedesigners.com>
Tue, 9 Jan 2024 21:31:31 +0000 (22:31 +0100)
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/FluxPostCarousel.php
wp-content/themes/physioassist/resources/functions.php
wp-content/themes/physioassist/resources/views/partials/post.blade.php
wp-content/themes/physioassist/resources/views/widgets/flux-post-carousel.blade.php

index 0e374b40c0e5bf863bdd4733bda66d6452711305..b75eff20dc33b2001367f16a10369e2c76b2f0c2 100644 (file)
@@ -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 = [
index 509e632fd6666ae0ee2f3cfa27363c6151913c2e..1dae87d74f6ca8284df40a1bda4fc713d71f3331 100644 (file)
@@ -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();
 }
index e5933ca6f23a4f5195516a901e79509692fbdf46..a005a0617607dd28e5d9ecee94ffe1d498516e50 100644 (file)
@@ -7,6 +7,6 @@ $format = $current_language === "en" ? "Y/m" : "m/Y";
     <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 --}}
index b1ab8e982773379c4e00de456538cca11fc1c46a..df9c6683b550a97ac84960f9d3d9fc3907d47639 100644 (file)
   <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']))