Wordpress sitemde 3x'lik bir kılavuzda yayınlarım var. Bu, çıktıyı üreten koddur.Grid'de Özel Gönderi Düzeni
<div class="first-post">
<?php if (have_posts()) : the_post(); ?>
<!-- calling first the_post(); will step the loop forward -->
<?php get_template_part('content','grid-firstpost'); ?>
<?php endif; ?>
</div>
<div class="other-posts">
<?php $i = 1; ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!-- the loop will be at the 2nd post here -->
<?php get_template_part('content','grid'); ?>
<?php if ($i%3 == 0) : ?>
<div class="clearfix"></div>
<?php endif; $i++; ?>
<?php if ($_SERVER["REQUEST_URI"] == '/'): ?>
<?php if ($i == 3): ?>
<?php if (have_posts()) : the_post(); ?>
<!-- calling the_post(); will step the loop forward -->
<?php get_template_part('content','grid-test'); ?>
<?php if ($i%3 == 0) : ?>
<div class="clearfix"></div>
<?php endif; $i++; ?>
<?php endif; ?>
<?php endif ?>
<?php endif ?>
<?php if ($i == 7): ?>
<div class="first-post">
<!-- making post 7 fullwidth -->
<?php get_template_part('content','grid-firstpost'); ?>
</div>
<?php endif ?>
<?php endwhile; wp_reset_query(); endif; ?>
</div>
Kılavuzdaki üçüncü nokta için özel bir div oluşturdum. Sorun şu ki, başlangıçta bu noktaya sahip olması gereken posta, özel div (<?php if ($i == 3): ?>)
nedeniyle gizlenmiş.
+ Tam geniş sonrası +
İlk mesaj İkinci Mesaj Özel Div
Dördüncü sonrası :
Yani çıkış böyledir 10 Beşinci Mesaj Altıncı Mesaj
olması gerektiği Ne:
+ Tam geniş sonrası +
Sonraki İlk İkinci Mesaj Özel Div
Üçüncü Mesaj Dördüncü Mesaj Beşinci Mesaj
Bunu çözmek için nasıl bilmiyorum.
Yalnızca siparişi buradan düzeltin, şimdi çalışmalı – larsAnders
Bu işe yaramıyor. 3 post sonrası ızgara durağı. Kod şimdi güncellendi. – Musa
Tamam, cevap düzenlenmiş. Bunu deneyin - bence ihtiyacınız olan tek şey – larsAnders