Edit File: pm18.php
<?php if( class_exists( 'CSF' ) ) { CSF::createWidget( 'orun_widget_post_module_18', array( 'title' => esc_html__( 'Oruno - Yazı Modülü #14', 'orun' ), 'class' => 'orun-widget-fields', 'classname' => 'orun-widget-post-module-18', 'description' => esc_html__( 'Yazılarınızı görüntülemenizi sağlayan #14 numaralı modülümüz.', 'orun' ), 'fields' => array( array( 'id' => 'title', 'type' => 'text', 'title' => esc_html__( 'Başlık:', 'orun' ), 'subtitle' => esc_html__( 'Yazı modülünün başlığını girin.', 'orun' ), 'help' => esc_html__( 'Yazı modülünün başlığını girin. Boş bırakırsanız modülün başlığı görünmez.', 'orun' ), ), array( 'id' => 'postcount', 'type' => 'number', 'title' => esc_html__( 'Yazı Sayısı:', 'orun' ), 'subtitle' => esc_html__( 'Yazı modülünde görüntülenecek yazı sayısını girin.', 'orun' ), 'help' => esc_html__( 'Varsayılan: 5, modülde kaç tane yazı görüntüleneceği belirleyin.', 'orun' ), 'default' => 16, ), array( 'id' => 'order', 'type' => 'select', 'title' => esc_html__( 'Sıralama:', 'orun' ), 'subtitle' => esc_html__( 'Yazıların sıralamasını seçin.', 'orun' ), 'help' => esc_html__( 'Yazılar seçtiğiniz sıralama türüne göre sıralanır.', 'orun' ), 'options' => array( 'date' => esc_html__( 'Son Eklenme Tarihine Göre', 'orun' ), 'modified' => esc_html__( 'Son Güncellenme Tarihine Göre', 'orun' ), 'meta_value_num' => esc_html__( 'En Çok Görüntülenme Sayısına Göre', 'orun' ), 'comment_count' => esc_html__( 'En Çok Yorum Sayısına Göre', 'orun' ), 'rand' => esc_html__( 'Rastgele', 'orun' ), ), ), array( 'id' => 'cat', 'type' => 'select', 'title' => esc_html__( 'Kategori:', 'orun' ), 'subtitle' => esc_html__( 'Yazıların görüntüleneceği kategori/kategorileri seçin.', 'orun' ), 'placeholder' => esc_html__( 'Tüm Kategoriler', 'orun' ), 'help' => esc_html__( 'Birden fazla kategori seçebilirsiniz. Hiç kategori seçmezseniz tüm kategorilerdeki yazılar listelenecektir.', 'orun' ), 'options' => 'categories', 'multiple' => true, 'chosen' => true, ), array( 'id' => 'offset', 'type' => 'number', 'title' => esc_html__( 'Offset Ayarı:', 'orun' ), 'subtitle' => esc_html__( 'Yazıların listelenmesi için offset ayarını girin.', 'orun' ), 'help' => esc_html__( 'Örnek: 5, yazıların 5. sıradan başlayarak listelenecektir.', 'orun' ), 'default' => '0', ), ) ) ); if (!function_exists('orun_widget_post_module_18')) { function orun_widget_post_module_18($args, $instance) { if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; } echo '<div class="orun-pm orun-pm-5 row">'; $args = array( 'order' => 'DESC', 'post_type' => 'post', 'posts_per_page' => $instance['postcount'], 'orderby' => $instance['order'], 'offset' => $instance['offset'], 'cat' => $instance['cat'], 'meta_key' => 'post_views_count', ); $query = new WP_Query($args); $i = 1; $carousel_opened = false; while ($query->have_posts()) { $query->the_post(); if ($i === 1) { echo '<div class="orun-pm-item orun-col-p100 orun-col-p100-sm">'; echo '<div class="custom owl-carousel">'; $carousel_opened = true; } if ($i <= 10) { get_template_part('template-parts/post/egitim/grid-1'); } else { if ($carousel_opened) { echo '</div>'; echo '</div>'; $carousel_opened = false; } get_template_part('template-parts/post/egitim/post-5', '1'); } $i++; } if ($carousel_opened) { echo '</div>'; echo '</div>'; } echo '</div>'; } } } ?>