Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 110 lines (85 sloc) 3.759 kB
37da33c @jayj Improvements to front page
authored
1 <?php
2 /**
3fb3ddb @jayj Inline documentation improvements
authored
3 * The template for displaying headlines from categories
4 * in the template-front-page.php page template
5 *
6 * Child Themes can replace this template part file via {section-headlines.php}
7 *
bda9730 @jayj PHPDoc changes. You can browse the documentation on http://wpthemes.j…
authored
8 * @package Cakifo
9 * @subpackage Template
37da33c @jayj Improvements to front page
authored
10 */
11 ?>
12
13 <?php do_atomic( 'before_headlines' ); // cakifo_before_headlines ?>
14
0116328 @jayj Spacing clean ups
authored
15 <section id="headlines" class="clearfix">
37da33c @jayj Improvements to front page
authored
16
17 <?php do_atomic( 'open_headlines' ); // cakifo_open_headlines ?>
18
0116328 @jayj Spacing clean ups
authored
19 <?php
20 $i = 0;
30f9e0d @jayj Code cleanup
authored
21
3fb3ddb @jayj Inline documentation improvements
authored
22 // Get the number of posts to show
b720779 @jayj Speed improvement on frontpage
authored
23 $number = ( hybrid_get_setting( 'headlines_num_posts' ) ) ? hybrid_get_setting( 'headlines_num_posts' ) : 4;
a08cd2c @jayj Huge commit
authored
24
3fb3ddb @jayj Inline documentation improvements
authored
25 // Loop through each selected category
0116328 @jayj Spacing clean ups
authored
26 foreach ( hybrid_get_setting( 'headlines_category' ) as $category ) :
27 ?>
37da33c @jayj Improvements to front page
authored
28 <?php
0116328 @jayj Spacing clean ups
authored
29 /**
3fb3ddb @jayj Inline documentation improvements
authored
30 * Create the loop for each selected category
31 *
32 * @uses $GLOBALS['cakifo_do_not_duplicate'] Exclude posts from the 'Recent Posts' section
33 */
37da33c @jayj Improvements to front page
authored
34 $headlines = get_posts( array(
0116328 @jayj Spacing clean ups
authored
35 'numberposts' => $number,
3fb3ddb @jayj Inline documentation improvements
authored
36 'post__not_in' => $GLOBALS['cakifo_do_not_duplicate'], // Don't show posts that are showing in the 'Recent Posts' section
0116328 @jayj Spacing clean ups
authored
37 'category' => $category,
38 'post_status' => 'publish',
39 'tax_query' => array(
40 array(
41 // Exclude posts with the Aside, Link, Quote, and Status format
42 'taxonomy' => 'post_format',
43 'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
44 'field' => 'slug',
45 'operator' => 'NOT IN',
46 ),
37da33c @jayj Improvements to front page
authored
47 ),
48 ) );
0116328 @jayj Spacing clean ups
authored
49 ?>
37da33c @jayj Improvements to front page
authored
50
0116328 @jayj Spacing clean ups
authored
51 <?php if ( ! empty( $headlines ) ) : ?>
37da33c @jayj Improvements to front page
authored
52
859098c @jayj Remove the Equal Heights In Rows script
authored
53 <div class="headline-list">
37da33c @jayj Improvements to front page
authored
54
55 <?php do_atomic( 'open_headline_list' ); // cakifo_open_headline_list ?>
56
0116328 @jayj Spacing clean ups
authored
57 <?php $cat = get_category( $category ); ?>
37da33c @jayj Improvements to front page
authored
58
57b5c24 @jayj LESS Part 2: Quotes and lists
authored
59 <h2 class="widget-title"><a href="<?php echo get_category_link( $category ); ?>" title="<?php echo esc_attr( $cat->name ); ?>"><?php echo $cat->name; ?></a></h2>
37da33c @jayj Improvements to front page
authored
60
0116328 @jayj Spacing clean ups
authored
61 <ol>
37da33c @jayj Improvements to front page
authored
62 <?php foreach ( $headlines as $post ) : $GLOBALS['cakifo_do_not_duplicate'][] = $post->ID; ?>
0116328 @jayj Spacing clean ups
authored
63 <li>
37da33c @jayj Improvements to front page
authored
64 <?php do_atomic( 'open_headline_list_item' ); // cakifo_open_headline_list_item ?>
65
0116328 @jayj Spacing clean ups
authored
66 <?php if ( current_theme_supports( 'get-the-image' ) ) { ?>
67 <div class="image">
20b33e4 @jayj Print style, Slides 1.1.8 and clean up
authored
68 <?php
3fb3ddb @jayj Inline documentation improvements
authored
69 // Get the thumbnail
37da33c @jayj Improvements to front page
authored
70 get_the_image( array(
0116328 @jayj Spacing clean ups
authored
71 'meta_key' => 'Thumbnail',
72 'size' => 'small',
73 'image_class' => 'thumbnail',
37da33c @jayj Improvements to front page
authored
74 'default_image' => THEME_URI . '/images/default-thumb-mini.gif'
75 ) );
0116328 @jayj Spacing clean ups
authored
76 ?>
77 </div>
78 <?php } ?>
37da33c @jayj Improvements to front page
authored
79
0116328 @jayj Spacing clean ups
authored
80 <div class="details">
81 <?php
3fb3ddb @jayj Inline documentation improvements
authored
82 /* Entry title */
0116328 @jayj Spacing clean ups
authored
83 echo apply_atomic( 'headline_entry_title', the_title( '<h3 class="' . esc_attr( $post->post_type ) . '-title entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h3>', false ) );
30f9e0d @jayj Code cleanup
authored
84
3fb3ddb @jayj Inline documentation improvements
authored
85 /* Entry meta */
86 echo apply_atomic_shortcode( 'headline_meta', '<span class="headline-meta">' . __( '[entry-published pubdate="no"] by [entry-author]', 'cakifo' ) . '</span>' );
87 ?>
0116328 @jayj Spacing clean ups
authored
88 </div> <!-- .details -->
37da33c @jayj Improvements to front page
authored
89
0116328 @jayj Spacing clean ups
authored
90 <?php do_atomic( 'close_headline_list_item' ); // cakifo_close_headline_list_item ?>
91 </li>
92 <?php endforeach; ?>
93 </ol>
37da33c @jayj Improvements to front page
authored
94
0116328 @jayj Spacing clean ups
authored
95 <?php do_atomic( 'close_headline_list' ); // cakifo_close_headline_list ?>
37da33c @jayj Improvements to front page
authored
96
0116328 @jayj Spacing clean ups
authored
97 </div> <!-- .headline-list -->
37da33c @jayj Improvements to front page
authored
98
0116328 @jayj Spacing clean ups
authored
99 <?php endif; ?>
37da33c @jayj Improvements to front page
authored
100
0116328 @jayj Spacing clean ups
authored
101 <?php endforeach; ?>
20b33e4 @jayj Print style, Slides 1.1.8 and clean up
authored
102
0116328 @jayj Spacing clean ups
authored
103 <?php unset( $GLOBALS['cakifo_do_not_duplicate'] ); // Kill the variable ?>
e2d1620 @jayj Small improvements
authored
104
0116328 @jayj Spacing clean ups
authored
105 <?php do_atomic( 'close_headlines' ); // cakifo_close_headlines ?>
37da33c @jayj Improvements to front page
authored
106
0116328 @jayj Spacing clean ups
authored
107 </section> <!-- #headlines -->
37da33c @jayj Improvements to front page
authored
108
30f9e0d @jayj Code cleanup
authored
109 <?php do_atomic( 'after_headlines' ); // cakifo_after_headlines ?>
Something went wrong with that request. Please try again.