Edit File: pm15.php
<?php if( class_exists( 'CSF' ) ) { CSF::createWidget( 'orun_widget_post_module_15', array( 'title' => esc_html__( 'Oruno - Sidebar Yazı Modülü #11', 'orun' ), 'class' => 'orun-widget-fields', 'classname' => 'orun-widget-post-module-15', 'description' => esc_html__( 'Yazılarınızı görüntülemenizi sağlayan #11 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' => 4, ), 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_15')) { function orun_widget_post_module_15($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-13 row">'; if (have_posts()) { $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); $post_number = 1; // Başlangıç numarası while ($query->have_posts()) { $query->the_post(); get_template_part('template-parts/post/teknoloji/post', '4', array('post_number' => $post_number)); $post_number++; // Sonraki numarayı artır } } echo '</div>'; } } } ?>