Druga pętla rozwala pierwszą. Problem z query
-
Posiadam następująca pętle która wyświetla listę wszystkich filmów w danej kategorii.
<?php $current_cat=get_the_category(); $current_category = $current_cat[0]->cat_ID; ?> <?php query_posts(array('showposts'=> -1, 'cat'=> $current_category, 'orderby'=> none)); ?> <?php while (have_posts()) : the_post(); ?> <? $vids = get_post_meta($post->ID, 'skrin', true); ?> <li class="lista-tematow"> <? if(!empty($vids)) { ?> <div class="clr"></div> <?} ?> <div style="margin-left:5px;float:left; width:450px;"><a href="<?php the_permalink() ?>"><?echo $n++; ?><?echo " ";?><?php the_title() ?> <? $excerpt = get_the_excerpt(); ?> </a></span></div></li> <?php endwhile;?>
Problem pojawia się kiedy nad nią utworze kolejną pętle. Po utworzeniu kolejnej źle zostają wyświetlane pozostałe kategorie. Na wszystkich kategoriach wyświetlane są wyniki tylko z jednej kategorii.
$current_category_ad = $current_cat_ad[0]->cat_ID; query_posts(array('showposts'=> -1, 'cat'=> $current_category_ad, 'orderby'=> none)); while (have_posts()) : the_post(); endwhile;
Gdzie popełniam błąd w trakcie tworzenia 2 pętli?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- Temat ‘Druga pętla rozwala pierwszą. Problem z query’ jest zamknięty na nowe odpowiedzi.