<?php // We need the im...

Download Link
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php

// We need the image sizes that are registered.
require_once( 'lib/image-size.php' );

function render_content() {
	
?>
	<?php if ( have_posts() ) : ?>
		<div class="loop">
			<div class="loop-header">
				<h4 class="loop-title">My Page Title</h4>
			</div>
			
			<?php 
				add_filter( 'excerpt_length', 'builder_magazine_excerpt_length' );
				add_filter( 'excerpt_more', 'builder_magazine_excerpt_more' );
			 ?>
			
			<div class="loop-content">
			<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=18&paged=$paged"); ?>
				<?php while ( have_posts() ) : // The Loop ?>
					<?php the_post(); ?>
					
					<div <?php post_class('magazine-post-wrap'); ?>>
							<div class='magazine-post entry-content'>
								<div class="entry-header">
									<?php if ( has_post_thumbnail() ) : ?>
										<div class="entry-meta">
											<a class="post-image" href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'it-magazine-thumb' ); ?></a>
										</div>
									<?php else : ?>
										<?php edit_post_link( '<img width="350" height="150" src="' . $base_url . '/images/no-feature-image.jpg" class="it-magazine-thumb no-thumb" />', '<div class="entry-meta post-image">', '</div>' ) ; ?>
									<?php endif; ?>
									
									<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
									<span class="entry-meta the_date"><?php echo get_the_date(); ?></span>
									<?php do_action( 'builder_comments_popup_link', '<span class="comments">', '</span>', __( '%s Comments', 'it-l10n-Builder' ), __( '0', 'it-l10n-Builder' ), __( '1', 'it-l10n-Builder' ), __( '%', 'it-l10n-Builder' ) ); ?>
								</div>
								
								<div class="entry-content">
									<?php the_excerpt(); ?>
								</div>
							</div>
						</div>
					<?php endwhile; // end of one post ?>
					
			</div>
			
			<div class="loop-footer">
				<!-- Previous/Next page navigation -->
				<div class="loop-utility clearfix">
					<div class="alignleft"><?php previous_posts_link( __( '« Previous Page', 'it-l10n-Builder' ) ); ?></div>
					<div class="alignright"><?php next_posts_link( __( 'Next Page »', 'it-l10n-Builder' ) ); ?></div>
				</div>
			</div>
		</div>
	<?php else : // do not delete ?>
		<?php do_action( 'builder_template_show_not_found' ); ?>
	<?php endif; // do not delete ?>
<?php
	// remember those modification to the excerpt above? Let's remove them now.
	remove_filter( 'excerpt_length', 'builder_magazine_excerpt_length' );
	remove_filter( 'excerpt_more', 'builder_magazine_excerpt_more' );
}

// Now let's edit the excerpt for this extension.
function builder_magazine_excerpt_length( $length ) {
	return 40;
}

// Cannot forget about the excerpt more link. Let's make it look like the posts default link.
function builder_magazine_excerpt_more( $more ) {
	global $post;
	return '...<p><a href="'. get_permalink( $post->ID ) . '" class="more-link">Read More→</a></p>';
}

add_action( 'builder_layout_engine_render_content', 'render_content' );

do_action( 'builder_layout_engine_render', basename( __FILE__ ) );