-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhome.php
51 lines (45 loc) · 1.38 KB
/
home.php
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
<?php
/**
* Home
*
* @package BE_Gallery
* @since 1.0.0
* @link https://github.com/billerickson/BE-Gallery
* @author Bill Erickson <[email protected]>
* @copyright Copyright (c) 2011, Bill Erickson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/
/**
* Home Content
* @since 1.0.0
*/
function be_home_content() {
global $post;
echo '<div class="left">';
echo '<p><a href="' . get_permalink() . '">' . get_the_post_thumbnail( $post->ID, 'medium' ) . '</a></p>';
echo '</div>';
echo '<div class="right">';
the_content();
echo '<h4>' . be_gallery_count( false ) . ' photos in this gallery</h4>';
$args = array(
'post_parent' => $post->ID,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'posts_per_page' => 4,
'order' => 'ASC',
'orderby' => 'menu_order date',
);
$attachments = get_children( $args );
echo '<div class="summary-listing">';
foreach( $attachments as $attachment ):
$image = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' );
echo '<a href="' . get_permalink( $attachment->ID ) . '"><img src="' . $image[0] . '" /></a>';
endforeach;
echo '</div><!-- .summary-listing -->';
echo '</div>';
}
add_action( 'genesis_post_content', 'be_home_content' );
remove_action( 'genesis_post_content', 'genesis_do_post_content' );
genesis();