Ürün kategori sayfası için bir tema oluşturdum. Sayfada, sayfanın alt sayfaları listeleniyor ama hiç bir yerden bir ayar yapmamama rağmen sayfada sadece 5 adet ürün görünüyor.
Şimdiden teşekkürler.
Alt Sayfa Listeleme Sorunu
9
●2.123
- 03-08-2013, 13:57:07Özel template dosyanızın kodlarını bir ekleyin, bakalım.BebboBRR adlı üyeden alıntı: mesajı görüntüle
- 03-08-2013, 14:03:49
<?php /* Template Name: Product Categories */ ?> <?php get_header(); ?> <div class="clearLeft"> </div> <div id="fullcontent"> <div class="fullcontenthead"> <h1><?php the_title(); ?></h1> </div> <div id="contentproductleft"> <ul class="productmenu"> <?php wp_list_pages('include=7,40,42,44,46,48,50,51,53&title_li='); ?> </ul> </div> <div id="contentproductlist"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php $children = get_posts(array('post_type' => 'page', 'post_parent' => $post->ID )); if ($children) { foreach ( $children as $child ){ $values = get_post_custom_values("Product_Image", $child->ID); $values1 = get_post_custom_values("Product_Price", $child->ID); $link = get_permalink($child->ID); $page_data = get_page($child->ID); ?> <div class="productbox"> <div class="productboxhead"> <a href="<?=$link?>"> <?=$child->post_title?> </a> </div> <div class="productboxleft"> <div class="productboxprice"> <? echo $values1[0]; ?> DHS </div> <div onClick="location.href='<?=$link?>'" style="cursor:pointer" class="productboxbt"> DETAILS </div> </div> <div class="productboxright"> <a href="<?=$link?>"> <img src="<? echo $values[0]; ?>" alt="" width="59" height="113" class="alignleft" /> </a> </div> </div> <? } } ?> <?php endwhile; else: ?> <div class="alert-box error">Desolé, la page demandé n'est pas trouvé...</div> <?php endif; ?> </div> <!-- .contentproductlist --> </div><!-- #fullcontent --> <div class="clearLeft"> </div> <?php get_footer(); ?>yakuphan adlı üyeden alıntı: mesajı görüntüle - 03-08-2013, 14:12:00
$children = get_posts(array('post_type' => 'page', 'post_parent' => $post->ID ));kodunu
$children = get_posts(array('post_type' => 'page', 'post_parent' => $post->ID, 'posts_per_page' => -1 ));Koddaki get_posts fonksiyonunun varsayılan yazı sayısı 5'tir, posts_per_page=-1 bunu sınırsız yapar. -1 yerine 10 yazarsanız ilk 10 tanesini alır.
Fonksiyon için ayrıntılı bilgi
http://codex.wordpress.org/Template_Tags/get_posts