Edit File: hikaye.php
<?php if (class_exists('CSF')) { CSF::createWidget('orun_widget_grid_module_31', array( 'title' => esc_html__('Oruno - Hikaye Bileşeni', 'orun'), 'class' => 'orun-widget-fields', 'classname' => 'orun-widget-grid-module-31', 'description' => esc_html__('Hikaye stiline sahip grid bir yapı sunar.', '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; overflow-x: auto; width: 100%; padding: 16px; box-sizing: border-box; } .story-item { width: 80px; height: 80px; border-radius: 50%; background-color: #ddd; margin-right: 12px; flex-shrink: 0; } .story-item:first-child { margin-left: 0; } .story-item:hover{ cursor:pointer; } ::-webkit-scrollbar { width: 6px; height: 5px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: #bbb; border-radius: 8px; } ::-webkit-scrollbar-thumb:hover { background: #999; } </style> <div class="instagram-stories-container"> <?php while ($query->have_posts()) : $query->the_post(); ?> <?php $thumbnail_url = get_the_post_thumbnail_url(get_the_ID(), 'thumbnail'); ?> <div class="story-item" style="background-image: url('<?php echo esc_url($thumbnail_url); ?>'); background-position: center; background-size: cover;" onclick="window.location.href='<?php echo esc_url(get_permalink()); ?>'"></div> <?php endwhile; ?> </div> <?php wp_reset_postdata(); } } } ?>