-
Notifications
You must be signed in to change notification settings - Fork 1
/
blog.php
79 lines (60 loc) · 2.65 KB
/
blog.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
<?php
/*
Template Name: Blog
*/
?>
<?php get_header(); ?>
<div id="container">
<div id="contents">
<?php do_action( 'bp_before_blog_home' ) ?>
<div id="content">
<div class="widget">
<div class="widgettitle"><?php _e( 'Blog', 'buddypress' ) ?></div>
<div class="widget-content">
<?php
//we need to manipulate query here right
global $wp_query;
$limit = get_option('posts_per_page');
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('showposts=' . $limit . '&paged=' . $paged);
$wp_query->is_archive = true;
$wp_query->is_home = false;
?>
<?php if ( have_posts() ) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php do_action( 'bp_before_blog_post' ) ?>
<div class="post" id="post-<?php the_ID(); ?>">
<?php if(has_post_thumbnail()):?>
<div class="post-thumb cb-thumb-wrap">
<?php the_post_thumbnail();?>
</div>
<?php endif;?>
<h2 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<p class="date"><?php the_time('F j, Y') ?> <em><?php _e( 'in', 'buddypress' ) ?> <?php the_category(', ') ?> <?php printf( __( 'by %s', 'buddypress' ), bp_core_get_userlink($post->post_author) ) ?></em></p>
<div class="entry">
<?php the_content( __( 'Read the rest of this entry »', 'buddypress' ) ); ?>
</div>
<p class="postmetadata"><span class="tags"><?php the_tags( __( 'Tags: ', 'buddypress' ), ', ', '<br />'); ?></span> <span class="comments"><?php comments_popup_link( __( 'No Comments »', 'buddypress' ), __( '1 Comment »', 'buddypress' ), __( '% Comments »', 'buddypress' ) ); ?></span><br class="clear" /></p>
<br class="clear" />
</div>
<?php do_action( 'bp_after_blog_post' ) ?>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link( __( '« Previous Entries', 'buddypress' ) ) ?></div>
<div class="alignright"><?php previous_posts_link( __( 'Next Entries »', 'buddypress' ) ) ?></div>
</div>
<?php else : ?>
<h2 class="center"><?php _e( 'Not Found', 'buddypress' ) ?></h2>
<p class="center"><?php _e( 'Sorry, but you are looking for something that isn\'t here.', 'buddypress' ) ?></p>
<?php locate_template( array( 'searchform.php' ), true ) ?>
<?php endif; ?>
<br class="clear" />
</div>
</div>
<?php do_action( 'bp_after_blog_home' ) ?>
</div>
<?php cb_get_sidebar("blog");?>
<br class="clear" />
</div>
</div><!--end of container-->
<?php get_footer(); ?>