forked from xwolfde/Piratenkleider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop.php
90 lines (82 loc) · 4.62 KB
/
loop.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
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
81
82
83
84
85
86
87
88
89
90
<?php
global $options;
$category_description = category_description();
if ( ! empty( $category_description ) )
echo '' . $category_description . '';
if ( ! have_posts() ) : ?>
<h1><?php _e( 'Nothing found', 'piratenkleider' ); ?></h1>
<p><?php _e( 'Please try to search:', 'piratenkleider' ); ?></p>
<div class="fullwidth"><?php get_search_form(); ?></div>
<?php endif;
if ( 'person'== get_post_type() ) {
$out = '';
$args = array(
'post_type' => 'person',
'order' => 'ASC',
'meta_key' => 'person_last_name',
'orderby' => 'meta_value',
'posts_per_page' => 30,
'offset' => 0
);
$person = new WP_Query( $args );
if( $person->have_posts() ) {
$out .= ' <table class="person">';
while ($person->have_posts() ) {
$person->the_post();
$post_id = $person->post->ID;
$out .= piratenkleider_display_person($post_id, 'table');
}
$out .= '</table>';
wp_reset_postdata();
} else {
$out = '<section class="shortcode person"><p>';
$out .= __('No personal information found.', 'piratenkleider');
$out .= "</p></section>\n";
}
wp_reset_query();
echo $out;
} else {
while ( have_posts() ) {
the_post();
/* gallery */
if ( in_category( _x('gallery', 'gallery category slug', 'piratenkleider') ) ) { ?>
<h2>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'piratenkleider' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h2>
<?php
piratenkleider_post_pubdateinfo();
if ( post_password_required() ) {
the_content();
} else {
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
?>
<a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
<p>
<?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'piratenkleider' ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'piratenkleider' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
$total_images
); ?>
</p>
<?php the_excerpt();
}
?>
<a href="<?php echo get_term_link( _x('gallery', 'gallery category slug', 'piratenkleider'), 'category' ); ?>"><?php _e( 'More images', 'piratenkleider' ); ?></a>
| <?php
comments_popup_link( __( 'Post a comment', 'piratenkleider' ), __( '1 Comment', 'piratenkleider' ), __( '% kommentare', 'piratenkleider' ) );
edit_post_link( __( 'Edit', 'piratenkleider' ), '|', '' );
} else {
echo piratenkleider_post_teaser($options['category-teaser-titleup'],$options['category-teaser-datebox'],$options['category-teaser-dateline'],$options['category-teaser-maxlength'],$options['teaser-thumbnail_fallback'],$options['category-teaser-floating']);
}
/* end of loop */
}
if ( $wp_query->max_num_pages > 1 ){
next_posts_link( __( '← Older entries', 'piratenkleider' ) );
previous_posts_link( __( 'Newer entries →', 'piratenkleider' ) );
}
}
?>