View difference between Paste ID: ESaeXfHe and rtR8vtzA
SHOW: | | - or go back to the newest paste.
1
<?php
2
/*
3
Template Name: Blog
4
*/
5
?>
6
<?php
7
/**
8
 * The template for displaying all pages.
9
 *
10
 * This is the template that displays all pages by default.
11
 * Please note that this is the WordPress construct of pages
12
 * and that other 'pages' on your WordPress site will use a
13
 * different template.
14
 *
15
 * @package Toolbox
16
 * @since Toolbox 0.1
17
 */
18
19
get_header(); ?>
20
21
		<div id="primary">
22
			<div id="content" role="main">
23
				<?php while ( have_posts() ) : the_post(); ?>
24
					<?php get_template_part( 'content', 'page' ); ?>
25
					
26-
if(is_front_page() || is_home()) {
26+
					<?php
27-
	include (ABSPATH . '/wp-content/plugins/coin-slider-4-wp/coinslider.php');
27+
					if(is_front_page() || is_home()) {
28-
}
28+
						include (ABSPATH . '/wp-content/plugins/coin-slider-4-wp/coinslider.php');
29
					} ?>
30
31-
<ul>
31+
					<?php
32-
<?php $myposts = get_posts('numberposts=2&offset='.$paged); 
32+
						$args = array(
33-
foreach($myposts as $post) : ?> 
33+
							'posts_per_page' => 2,
34-
<?php setup_postdata($post);
34+
							'paged'          => get_query_var( 'paged' )
35-
unset($categories); 
35+
						);
36
37-
foreach (get_the_category() as $category)
37+
						$myposts = new WP_Query( $args ); ?>
38-
      $categories[] = $category->cat_name;
38+
39-
?> 
39+
						<?php if( $myposts->have_posts() ) : ?>
40-
<li>
40+
41-
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
41+
							<ul>
42-
<?php get_the_image('default_size=medium&width=560px&height=200px&image_class=post-thumb'); ?>
42+
								<?php while( $myposts->have_posts() ) : $myposts->the_post(); ?>
43-
<?php the_excerpt(); ?>
43+
									<li>
44-
</li>
44+
										<p>
45-
<?php endforeach; ?> 
45+
											<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
46-
QUI LINK POST PRECEDENTI / POST SUCCESSIVI
46+
												<?php the_title(); ?>
47-
</ul>
47+
											</a>
48-
<?php comments_template( '', true ); ?>
48+
										</p>
49
										<p>
50
											<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
51
												<?php the_post_thumbnail( 'medium' ); ?>
52
											</a>
53
										</p>
54
										<p><?php the_excerpt(); ?></p>
55
									</li>
56
								<?php endwhile; ?>
57
							</ul>
58
59
							<nav id="nav-below">
60
								<div class="nav-previous">
61
									<?php next_posts_link( '&larr; Pagina precedente', $myposts->max_num_pages ); ?>
62
								</div>
63
								<div class="nav-next">
64
									<?php previous_posts_link( 'Pagina successiva &rarr;', $myposts->max_num_pages ); ?>
65
								</div>
66
							</nav>
67
68
						<?php endif; ?>
69
70
						<?php wp_reset_postdata(); ?>
71
72
					<?php comments_template( '', true ); ?>
73
74
				<?php endwhile; // end of the loop. ?>
75
76
			</div><!-- #content -->
77
		</div><!-- #primary -->
78
79
<?php get_sidebar(); ?>
80
<?php get_footer(); ?>