ana sayfada belirlenen kategorilerin yazılarını görüntülemek istiyorum bunu okuma ayarlarından oluşturduğum şablonu seçerek yapıyorum fakat bu seferde sayfalama (http://site.com/page/1/...2,3 ...vs) çalışmıyor
ne şekilde yapılırsa yapılsın ana sayfada belli bir kategorinin yazılarının görüntülenmesi sağlandığında sayfalama (pagenavi) iptal oluyor sadece kategori sayfalarında çalışıyor
bir çözümü varmı
ana sayfada 1 kategori yazılarını görüntüleme ve sayfalama sorunu
13
●1.644
- 13-10-2010, 10:58:00bu gün yeni bilgiler buldum sanırım bu olay mümkün ama denemeler olumlu değil
kullanacağım ana sayfa sablonu (bu şablonda sayfalama çalışmıyor)
<div id="acat"> <div class="tab"> <ul> <li id="acat1" onmouseover="setTab('acat',1,3)" class="current"><span><?php wp_list_categories('include=11&title_li=&style=none'); ?></span></li> <li id="acat2" onmouseover="setTab('acat',2,3)"><span><?php wp_list_categories('include=21&title_li=&style=none'); ?></span></li> <li id="acat3" onmouseover="setTab('acat',3,3)"><span><?php wp_list_categories('include=195&title_li=&style=none'); ?></span></li> </ul> </div> <?php $display_categories = array(11,21,195); $i = 1; foreach ($display_categories as $category) { ?> <div id="con_acat_<?php echo $i; ?>"> <?php query_posts("showposts=1&cat=$category")?> <?php while (have_posts()) : the_post(); ?> <div class="cats"> <img src="<?php get_thumb($post->ID, 'full'); ?>" width="100" height="120" alt="<?php the_title(); ?>" /> </div> <div class="catstxt"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php post_limit('200'); ?> </div> <?php endwhile; ?> <div class="clear"></div> <div class="catlist"> <?php query_posts("showposts=4&offset=1&cat=$category")?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> </div> </div> <?php $i++; ?> <?php } ?> </div> <div id="bcat"> <div class="tab"> <ul> <li id="acat1" onmouseover="setTab('acat',1,3)" class="current"><span><?php wp_list_categories('include=12&title_li=&style=none'); ?></span></li> <li id="acat2" onmouseover="setTab('acat',2,3)"><span><?php wp_list_categories('include=22&title_li=&style=none'); ?></span></li> <li id="acat3" onmouseover="setTab('acat',3,3)"><span><?php wp_list_categories('include=197&title_li=&style=none'); ?></span></li> </ul> </div> <?php $display_categories = array(12,22,197); $i = 1; foreach ($display_categories as $category) { ?> <div id="con_bcat_<?php echo $i; ?>"> <?php query_posts("showposts=1&cat=$category")?> <?php while (have_posts()) : the_post(); ?> <div class="cats"> <img src="<?php get_thumb($post->ID, 'full'); ?>" width="100" height="120" alt="<?php the_title(); ?>" /> </div> <div class="catstxt"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php post_limit('200'); ?> </div> <?php endwhile; ?> <div class="clear"></div> <div class="catlist"> <?php query_posts("showposts=4&offset=1&cat=$category")?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> </div> </div> <?php $i++; ?> <?php } ?> </div>bulduğum kodlar:
http://www.wpbot.ru/?p=220
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1;query_posts("cat=-9,-15&paged=$page&posts_per_page=2"); ?>http://wordpress.org/support/topic/n...lems?replies=6
query_posts("cat=-5,-71&paged=$page&posts_per_page=7"); ?> - 13-10-2010, 14:26:17ilginiz için teşekkürler hocam ama kodu nereye ve ne kadar ekleyeceğimi bilmiyorum aşağıdaki kod ile deneme yaptım ama hata verdiezoryak adlı üyeden alıntı: mesajı görüntüle
<?php } } wp_reset_query(); ?>
- 13-10-2010, 15:50:47isyankar24 adlı üyeden alıntı: mesajı görüntüle
hocam şimdi ana sayfa için sabit sayfa kullanıyoruz ben aşağıdaki sayfayı hazırladım bu sayfayı index2.php olarak kayıt ettim bu şablon ile tüm kategorilerin yazılarını görüntüleyeceğim bir nevi portal görünümü olacak
<?php /* Template Name: index2 */ ?> <?php get_header(); ?> <div id="content" class="narrowcolumn"> <div id="acat"> <div class="tab"> <ul> <li id="acat1" onmouseover="setTab('acat',1,3)" class="current"><span><?php wp_list_categories('include=1&title_li=&style=none'); ?></span></li> <li id="acat2" onmouseover="setTab('acat',2,3)"><span><?php wp_list_categories('include=2&title_li=&style=none'); ?></span></li> <li id="acat3" onmouseover="setTab('acat',3,3)"><span><?php wp_list_categories('include=3&title_li=&style=none'); ?></span></li> </ul> </div> <?php $display_categories = array(1,2,3); $i = 1; foreach ($display_categories as $category) { ?> <div id="con_acat_<?php echo $i; ?>"> <?php query_posts("showposts=1&cat=$category")?> <?php while (have_posts()) : the_post(); ?> <div class="cats"> <img src="<?php get_thumb($post->ID, 'full'); ?>" width="100" height="120" alt="<?php the_title(); ?>" /> </div> <div class="catstxt"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php post_limit('200'); ?> </div> <?php endwhile; ?> <div class="clear"></div> <div class="catlist"> <?php query_posts("showposts=4&offset=1&cat=$category")?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> </div> </div> <?php $i++; ?> <?php } ?> </div> <div id="bcat"> <div class="tab"> <ul> <li id="bcat1" onmouseover="setTab('bcat',1,3)" class="current"><span><?php wp_list_categories('include=4&title_li=&style=none'); ?></span></li> <li class="" id="bcat2" onmouseover="setTab('bcat',2,3)"><span><?php wp_list_categories('include=5&title_li=&style=none'); ?></span></li> <li class="" id="bcat3" onmouseover="setTab('bcat',3,3)"><span><?php wp_list_categories('include=6&title_li=&style=none'); ?></span></li> </ul> </div> <?php $display_categories = array(4,5,6); $i = 1; foreach ($display_categories as $category) { ?> <div id="con_bcat_<?php echo $i; ?>"> <?php query_posts("showposts=1&cat=$category")?> <?php while (have_posts()) : the_post(); ?> <div class="cats"> <img src="<?php get_thumb($post->ID, 'full'); ?>" width="100" height="120" alt="<?php the_title(); ?>" /> </div> <div class="catstxt"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php post_limit('200'); ?> </div> <?php endwhile; ?> <div class="clear"></div> <div class="catlist"> <?php query_posts("showposts=4&offset=1&cat=$category")?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> </div> </div> <?php $i++; ?> <?php } ?> </div> <div id="ccat"> <div class="tab"> <ul> <li id="ccat1" onmouseover="setTab('ccat',1,3)" class="current"><span><?php wp_list_categories('include=7&title_li=&style=none'); ?></span></li> <li class="" id="ccat2" onmouseover="setTab('ccat',2,3)"><span><?php wp_list_categories('include=8&title_li=&style=none'); ?></span></li> <li class="" id="ccat3" onmouseover="setTab('ccat',3,3)"><span><?php wp_list_categories('include=9&title_li=&style=none'); ?></span></li> </ul> </div> <?php $display_categories = array(7,8,9); $i = 1; foreach ($display_categories as $category) { ?> <div id="con_ccat_<?php echo $i; ?>"> <?php query_posts("showposts=1&cat=$category")?> <?php while (have_posts()) : the_post(); ?> <div class="cats"> <img src="<?php get_thumb($post->ID, 'full'); ?>" width="100" height="120" alt="<?php the_title(); ?>" /> </div> <div class="catstxt"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php post_limit('200'); ?> </div> <?php endwhile; ?> <div class="clear"></div> <div class="catlist"> <?php query_posts("showposts=4&offset=1&cat=$category")?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> </div> </div> <?php $i++; ?> <?php } ?> </div> <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } else{ ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Eski Yazılar') ?></div> <div class="alignright"><?php previous_posts_link('Yeni Yazılar »') ?></div> </div> <?php } ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
kodlarda en üste
<?php /* Template Name: index2 */ ?>
ekledim artık şablon hazır sonra sayfalar bölümünden bir sayfa oluşturuyorum şablon olarak "index2" yani ana sayfa için hazırladığım şablonu seçiyorum
sonra Ayarlar / Okuma Ayarları / Ön sayfa görünümleri / bölümünden ""Sabit sayfa (aşağıda seçin) "" işaretleyip "index2" şablonunu kullanarak oluşturduğum sayfayı seçiyorum
artık ana sayfada hazırladığım şablon kullanılıyor fakat bu şablon ile navigasyon sayfa 2, 3, ,4 .... olayı iptal oluyor
----------------------------------------------------------
ezoryak adlı üyeden alıntı: mesajı görüntüle
hocam teşekkürler kodu denedim sayfalama kodlarının öncesinde kullandığımda sayfalama (pagenavi) görünmüyor iptal oluyor sonrasında kullandığım zamanda etkisi olmuyor - 13-10-2010, 15:59:06aşağıdaki şekilde denermisiniz.
<?php /* Template Name: index2 */ ?> <?php get_header(); ?> <div id="content" class="narrowcolumn"> <div id="acat"> <div class="tab"> <ul> <li id="acat1" onmouseover="setTab('acat',1,3)" class="current"><span><?php wp_list_categories('include=1&title_li=&style=none'); ?></span></li> <li id="acat2" onmouseover="setTab('acat',2,3)"><span><?php wp_list_categories('include=2&title_li=&style=none'); ?></span></li> <li id="acat3" onmouseover="setTab('acat',3,3)"><span><?php wp_list_categories('include=3&title_li=&style=none'); ?></span></li> </ul> </div> <?php $display_categories = array(1,2,3); $i = 1; foreach ($display_categories as $category) { ?> <div id="con_acat_<?php echo $i; ?>"> <?php query_posts("showposts=1&cat=$category")?> <?php while (have_posts()) : the_post(); ?> <div class="cats"> <img src="<?php get_thumb($post->ID, 'full'); ?>" width="100" height="120" alt="<?php the_title(); ?>" /> </div> <div class="catstxt"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php post_limit('200'); ?> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> <div class="clear"></div> <div class="catlist"> <?php query_posts("showposts=4&offset=1&cat=$category")?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> </div> </div> <?php $i++; ?> <?php } ?> <?php wp_reset_query(); ?> </div> <div id="bcat"> <div class="tab"> <ul> <li id="bcat1" onmouseover="setTab('bcat',1,3)" class="current"><span><?php wp_list_categories('include=4&title_li=&style=none'); ?></span></li> <li class="" id="bcat2" onmouseover="setTab('bcat',2,3)"><span><?php wp_list_categories('include=5&title_li=&style=none'); ?></span></li> <li class="" id="bcat3" onmouseover="setTab('bcat',3,3)"><span><?php wp_list_categories('include=6&title_li=&style=none'); ?></span></li> </ul> </div> <?php $display_categories = array(4,5,6); $i = 1; foreach ($display_categories as $category) { ?> <div id="con_bcat_<?php echo $i; ?>"> <?php query_posts("showposts=1&cat=$category")?> <?php while (have_posts()) : the_post(); ?> <div class="cats"> <img src="<?php get_thumb($post->ID, 'full'); ?>" width="100" height="120" alt="<?php the_title(); ?>" /> </div> <div class="catstxt"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php post_limit('200'); ?> <?php wp_reset_query(); ?> </div> <?php endwhile; ?> <div class="clear"></div> <div class="catlist"> <?php query_posts("showposts=4&offset=1&cat=$category")?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> <?php wp_reset_query(); ?> </ul> </div> </div> <?php $i++; ?> <?php } ?> </div> <div id="ccat"> <div class="tab"> <ul> <li id="ccat1" onmouseover="setTab('ccat',1,3)" class="current"><span><?php wp_list_categories('include=7&title_li=&style=none'); ?></span></li> <li class="" id="ccat2" onmouseover="setTab('ccat',2,3)"><span><?php wp_list_categories('include=8&title_li=&style=none'); ?></span></li> <li class="" id="ccat3" onmouseover="setTab('ccat',3,3)"><span><?php wp_list_categories('include=9&title_li=&style=none'); ?></span></li> </ul> </div> <?php $display_categories = array(7,8,9); $i = 1; foreach ($display_categories as $category) { ?> <div id="con_ccat_<?php echo $i; ?>"> <?php query_posts("showposts=1&cat=$category")?> <?php while (have_posts()) : the_post(); ?> <div class="cats"> <img src="<?php get_thumb($post->ID, 'full'); ?>" width="100" height="120" alt="<?php the_title(); ?>" /> </div> <div class="catstxt"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php post_limit('200'); ?> <?php wp_reset_query(); ?> </div> <?php endwhile; ?> <div class="clear"></div> <div class="catlist"> <?php query_posts("showposts=4&offset=1&cat=$category")?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> </div> </div> <?php $i++; ?> <?php } ?> <?php wp_reset_query(); ?> </div> <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } else{ ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Eski Yazılar') ?></div> <div class="alignright"><?php previous_posts_link('Yeni Yazılar »') ?></div> </div> <?php } ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>