Pereiti prie turinio

Wordpress pagalba.


Rekomenduojami pranešimai

Sveiki, iškilo bėda. Kodėl pasirinkus tam tikra kategorija išmeta visus postus, o ne pasirinktos kategorijos postus ?

 

<?php get_header(); ?>

<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="archiveTitle">Category: <strong><?php single_cat_title(); ?></strong></h2>

<?php /* If this is a category archive */ } elseif (is_tag()) { ?>
<h2 class="archiveTitle">Tag: <strong><?php single_tag_title(); ?></strong></h2>

<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2 class="archiveTitle">Month: <strong><?php the_time('F, Y'); ?></strong></h2> <?php } ?>

<?php
// Show a selected number of posts per row
$posts_per_row = 4;
$posts_per_page = 8;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
  'posts_per_page' => $posts_per_page,
  'paged' => $paged,
);
query_posts($args);
if (have_posts()) {
  while (have_posts()) {
     the_post();
     if ((++$post_counter % $posts_per_row) == 1  || $posts_per_row == 1) {
        if ($post_counter > 1) {
           echo "</div><!-- End of post_row -->\n";  // End previous row
        }
        echo "<div class='post_row'>\n";  // Start a new row
     }
     echo "<div class='post_class'>\n";  // Start one post
        // Output post data here
	 ?>
   <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Template <?php the_title_attribute(); ?>">
<?php if (strlen($post->post_title) > 40) {
echo substr(the_title($before = '', $after = '', FALSE), 0, 40) . '....'; } else {
the_title();
} ?>
</a></h2>
<?php
     echo "</div><!-- End of post_class -->\n";  // End of post
  } ?>
  </div><!-- End of post_row -->
  <div style='clear:both;'></div>
<div id='pagenavi'>
<?php wp_pagenavi(); ?>
</div>
<?php } else {
  // Code for no posts found
}
?>z
<div style='clear:both;'></div>
<?php get_footer(); ?>

Nuoroda į pranešimą
Dalintis kituose puslapiuose

Prisijunkite prie diskusijos

Jūs galite rašyti dabar, o registruotis vėliau. Jeigu turite paskyrą, prisijunkite dabar, kad rašytumėte iš savo paskyros.

Svečias
Parašykite atsakymą...

×   Įdėta kaip raiškusis tekstas.   Atkurti formatavimą

  Only 75 emoji are allowed.

×   Nuorodos turinys įdėtas automatiškai.   Rodyti kaip įprastą nuorodą

×   Jūsų anksčiau įrašytas turinys buvo atkurtas.   Išvalyti redaktorių

×   You cannot paste images directly. Upload or insert images from URL.

Įkraunama...
  • Dabar naršo   0 narių

    Nei vienas registruotas narys šiuo metu nežiūri šio puslapio.

×
×
  • Pasirinkite naujai kuriamo turinio tipą...