http://spazifluidi.altervista.org/blog/?page_id=51
Ho modificato dei file di un tema (slim) ma nonostante il codice sia presumo corretto non mi compare la paginazione: qualcuno sa dove possa essere il problema? vi allego il file index.php,il file (blog.php) del template che include
e il file della pagination.php (che è quello originale, che non ho modificato)
grazie
file index.php
file blog.phpcodice:<?php $options = get_option( 'slim_theme_settings' ); ?> <?php get_header(' '); ?> <?php if ($options['disable_feat_posts'] != true) { ?> <?php $featcat = $options['feat_posts']; ?> <div id="feat-posts"> <?php query_posts(array( 'category_name' => ' '. $featcat .' ', 'posts_per_page' => 4 )); ?> <ul> <?php while (have_posts()) : the_post(); ?> [*] " class="opacity"><?php the_post_thumbnail('featured-image'); ?> <h2>"><?php the_title(); ?></h2> <div class="triangle"></div> <?php endwhile; ?> [/list] </div> <?php } ?> <div id="post-wrap"> <div id="post-content"> <?php query_posts( array( 'paged'=>$paged ) ); ?> <?php if (have_posts()) : ?> <?php get_template_part( 'blog' , '') ?> <?php endif; ?> <?php if (function_exists("pagination")) { pagination($additional_loop->max_num_pages); } ?> </div> <?php get_sidebar(' '); ?> <div class="clear"></div> </div> <?php get_footer(' '); ?>
file pagination.phpcodice:<?php query_posts( array( 'paged'=>$paged ) ); ?> <?php $myposts = get_posts('numberposts=3');?> <? foreach($myposts as $post) : ?> <div class="post-entry" style="border-right:1px dotted blue;border-bottom: 1px dotted #666666"> <h2>"><?php the_title(); ?></h2> <div class="post-entry-meta">Posted by <?php the_author(); ?> on <?php the_time('F jS, Y') ?> in <?php the_category(' '); ?> ~ <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></div> <?php if ( has_post_thumbnail() ) { ?> <div class="post-entry-featured-image"> " class="opacity"><?php the_post_thumbnail('post-image'); ?> </div> <?php } ?> <?php setup_postdata($post); ?> <?php the_excerpt(''); ?> ">Leggi tutto... </div> <?php endforeach; ?>
codice:<?php function pagination($pages = '', $range = 4) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"".$i.""; } } echo "</div>\n"; } } ?>


Rispondi quotando