Edit File: grid1.php
<?php if (class_exists('CSF')) { CSF::createWidget('orun_widget_grid_module_1', array( 'title' => esc_html__('Oruno - Grid Modülü #1', 'orun'), 'class' => 'orun-widget-fields', 'classname' => 'orun-widget-grid-module-1', 'description' => esc_html__('Grid modülünü görüntüler.', 'orun'), 'fields' => array( 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' => 'icerik_sayisi', 'type' => 'number', 'title' => esc_html__( 'Kaç yazı gösterilsin Ayarı:', 'orun' ), 'subtitle' => esc_html__( 'Yazıların listelenmesi için Kaç yazı gösterilsin ayarını girin.', 'orun' ), 'default' => '12', ), 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', ), array( 'id' => 'slider', 'type' => 'switcher', 'title' => esc_html__('Slider Ayarı:', 'orun'), 'subtitle' => esc_html__('Grid modülünü slider olarak görüntülemeyi sağlar.', 'orun'), 'help' => esc_html__('Eğer slider görüntülemek istiyorsanız aktif edin.', 'orun'), 'default' => false, 'text_on' => esc_html__('Açık', 'orun'), 'text_off' => esc_html__('Kapalı', 'orun'), 'text_width' => '75' ), ) ) ); if (!function_exists('orun_widget_grid_module_1')) { function orun_widget_grid_module_1($args, $instance) { $classes = array(); if ($instance['fullwidth']) { $classes[] = 'container-fluid'; $classes[] = 'grid-fw'; } else { $classes[] = 'container'; } if ($instance['slider']) { $classes[] = 'owl-carousel'; $classes[] = 'owl-item'; $postcount = $instance['icerik_sayisi']; } else { $postcount = 1; } $classes = implode(' ', $classes); ?> <h2 style="display:none">Yeni İçerikler</h2> <div class="<?= $classes ?>"> <?php if (have_posts()) { $args = array( 'order' => 'DESC', 'orderby' => $instance['order'], 'cat' => $instance['cat'], 'offset' => $instance['offset'], 'meta_key' => 'post_views_count', 'showposts' => $postcount, ); $query = new WP_Query($args); $i = 1; while ($query->have_posts()): $query->the_post(); echo '<div class="row orun-grid orun-grid-1">'; echo '<div class="orun-grid-start orun-border orun-col-p100 orun-col-p100-sm big full">'; get_template_part('template-parts/grid/grid-1'); echo '</div>'; echo '</div>'; $i++; endwhile; } ?> </div> <?php } } } ?>