Edit File: hikaye.php
<?php if (class_exists('CSF')) { CSF::createWidget('orun_widget_grid_module_31', array( 'title' => esc_html__('Oruno - Hikaye şeklinde Grid', 'orun'), 'class' => 'orun-widget-fields', 'classname' => 'orun-widget-grid-module-31', 'description' => esc_html__('Hikaye 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' => '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_grid_module_31')) { function orun_widget_grid_module_31($args, $instance) { $query_args = array( 'order' => 'DESC', 'orderby' => $instance['order'], 'cat' => $instance['cat'], 'offset' => $instance['offset'], 'meta_key' => 'post_views_count', 'posts_per_page' => -1, // Tüm yazıları getir ); $query = new WP_Query($query_args); ?> <style> .instagram-stories-container { display: flex; justify-content:center; overflow-x: auto; width: 100%; padding:12px; padding-bottom: 35px; box-sizing: border-box; overflow-y: hidden; margin-bottom:45px; } .story-item { width: 80px; height: 80px; border-radius: 50%; background-color: #ddd; margin-right: 12px; flex-shrink: 0; cursor:pointer; position: relative; } .story-item p { width: 100%; text-align: center; margin-top: 8px; } .story-item-thumbnail { width: 100%; height: 100%; background-position: center; background-size: cover; border-radius: 50%; } .story-item:first-child { margin-left: 0; } .story-item:hover{ cursor:pointer; } ::-webkit-scrollbar { width: 6px; height: 3px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: #3E5A3F; border-radius: 8px; margin-top:15px; } ::-webkit-scrollbar-thumb:hover { background: #999; } .title-widget{ font-family:'Inter'; font-size:13px; } </style> <div class="instagram-stories-container"> <?php while ($query->have_posts()) : $query->the_post(); ?> <div class="story-item" style=""> <?php $thumbnail_url = get_the_post_thumbnail_url(get_the_ID(), 'thumbnail'); ?> <div class="story-item-thumbnail" style="background-image: url('<?php echo esc_url($thumbnail_url); ?>');" onclick="window.location.href='<?php echo esc_url(get_permalink()); ?>'"></div> <p style="title-widget"><?php echo mb_strimwidth(get_the_title(), 0, 9, '...'); ?></p> </div> <?php endwhile; ?> </div> <?php wp_reset_postdata(); } } } ?>