Salut.
Nu stiu de ce, dar nu-mi merge paginatia pentru subcategorii. Pentru categorii merge de minune, dar nu si pentru subcategorii. Oare am gresit ceva in cod?
in fisierul archive.php am urmatorul cod:
Cod PHP:<?php get_header(); ?>
<div id="contents">
<section id="main">
<div class="clear"></div>
<div id="leftcontainer">
<div class="articol_scurt">
<div class="titlu_cat">
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="pagetitle">Navigati in categoria "<?php single_cat_title(); ?>"</h2>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h2 class="pagetitle">Navigati in articolele cu tagul "<?php single_tag_title(); ?>"</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2 class="pagetitle">Navigati in arhiva lunii"<?php the_time('F jS, Y'); ?>"</h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2 class="pagetitle">Navigati in arhiva lunii<?php the_time('F, Y'); ?>"</h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2 class="pagetitle">Navigati in arhiva anului<?php the_time('Y'); ?>"</h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2 class="pagetitle">Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="pagetitle">Blog Archives</h2>
<?php } ?>
</div>
<div class="clear"></div>
<section class="articol_scurtt">
<br/>
<?php while (have_posts()) : the_post(); ?>
<article class="articol">
<header>
<?php
//This must be in one loop
if(has_post_thumbnail()) {
the_post_thumbnail(array(60,60), array('class' => 'alignleft'));
} else {
echo '<img src="'.get_bloginfo("template_url").'/images/preview-little.png" alt="A" />';
}
?>
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<p class="articolinfo"><time><?php the_time('F jS Y') ?></time> | <?php comments_popup_link('Nici un comentariu', '1 comentariu ', '% comentarii'); ?></p>
</header>
</article>
<?php endwhile; ?>
<div class="navigation">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
<?php } ?>
</div>
<?php else :
if ( is_category() ) { // If this is a category archive
printf("<h2 class='pagetitle'>Nu am gasit niciun articol.</h2>", single_cat_title('',false));
} else if ( is_date() ) { // If this is a date archive
echo("<h2 class='pagetitle'>Nu am gasit niciun articol.</h2>");
} else if ( is_author() ) { // If this is a category archive
$userdata = get_userdatabylogin(get_query_var('author_name'));
printf("<h2 class='pagetitle'>Nu am gasit niciun articol.</h2>", $userdata->display_name);
} else {
echo("<h2 class='pagetitle'>Nu am gasit niciun articol.</h2>");
}
endif;
?>
<div class="clear"></div>
</div>
<div class="clear"></div>
</section>
<?php get_sidebar(); ?>
<?php get_footer(); ?>



Răspunde cu citat