Skip to content

Commit

Permalink
basic comments working again
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Louie committed Dec 14, 2012
1 parent 5ada17e commit 6ac9001
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 23 deletions.
65 changes: 44 additions & 21 deletions themes/scacseattle.org/content-sermon-series.php
Expand Up @@ -5,34 +5,57 @@
*/
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', '_s' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>

<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php _s_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
<article id="post-<?php the_ID(); ?>" <?php post_class("sermon-list-post"); ?>>
<header class="entry-header clearfix">
<table>
<tr>
<td class="entry-title-container">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', '_s' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
</td>
<td class="sermon-speaker-container">
<?php if (get_post_type() == 'ct_sermon') : ?>
<div class="sermon-speaker">
<?php echo get_the_term_list($post->ID, 'sermon_speaker'); ?>
</div>
<?php endif; ?>
</td>
</tr>
</table>

</header><!-- .entry-header -->

<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php elseif (get_post_type() != 'ct_sermon') : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', '_s' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php else :
echo('<p>'.get_the_term_list($post->ID, 'sermon_speaker').'</p>');
<div class="sermon-info-container clearfix">
<div class="sermon-short-desc">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas posuere euismod odio, eu imperdiet lectus ullamcorper vitae. Morbi quam lacus, malesuada suscipit varius sit amet, bibendum eget leo. Donec ut tellus ligula, id fermentum nisi. Mauris dolor sapien, accumsan nec blandit id, tempus in ipsum. In hac habitasse platea dictumst. In luctus neque metus, a sollicitudin enim. Fusce et leo mi. Quisque blandit, nisl sit amet fringilla hendrerit, tellus nibh venenatis purus, non consequat nibh lorem ac arcu. Pellentesque pulvinar, ante a bibendum aliquet, orci massa solli...
</div>
<div class="sermon-info">
<?php the_time('M j, Y'); ?>
<div class="comments-cnt">
<a href="<?php comments_link(); ?>" class="comments-link">
<?php
$ccnt = get_comments_number();
switch($ccnt){
case 0:
echo "No Comments";
break;
case 1:
echo "1 Comment";
break;
default:
echo "$ccnt Comments";
break;
}
?>
</a>
</div>
</div>
<?php
$args = array( 'post_type' => 'ct_sermon', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
// echo '</div>';
endwhile;
?>
<?php endif; ?>
</div>

</article><!-- #post-<?php the_ID(); ?> -->
59 changes: 59 additions & 0 deletions themes/scacseattle.org/content-sermon.php
@@ -0,0 +1,59 @@
<?php
/**
* @package _s
* @since _s 1.0
*/
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>

<div class="entry-meta">
<?php _s_posted_on(); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->

<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->

<footer class="entry-meta">
<?php
/* translators: used between list items, there is a space after the comma */
$category_list = get_the_category_list( __( ', ', '_s' ) );

/* translators: used between list items, there is a space after the comma */
$tag_list = get_the_tag_list( '', ', ' );

if ( ! _s_categorized_blog() ) {
// This blog only has 1 category so we just need to worry about tags in the meta text
if ( '' != $tag_list ) {
$meta_text = __( 'This entry was tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', '_s' );
} else {
$meta_text = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', '_s' );
}

} else {
// But this blog has loads of categories so we should probably display them here
if ( '' != $tag_list ) {
$meta_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', '_s' );
} else {
$meta_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', '_s' );
}

} // end check for categories on this blog

printf(
$meta_text,
$category_list,
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
?>

<?php edit_post_link( __( 'Edit', '_s' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
2 changes: 1 addition & 1 deletion themes/scacseattle.org/header.php
Expand Up @@ -68,7 +68,7 @@
</div>

<div class="csl-container">
<a href="http://chinese.scacseattle.org/" class="chinese-service-link">Chinese</a>
<a href="http://chinese.scacseattle.org/" class="chinese-service-link">中國服務</a>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions themes/scacseattle.org/sass/homepage.css.sass
@@ -1,4 +1,5 @@
.flexslider
min-height: 300px
border: 0px
overflow: hidden
margin: 30px 0 30px 0
Expand Down
24 changes: 24 additions & 0 deletions themes/scacseattle.org/sass/sermons.css.sass
@@ -1,3 +1,27 @@
.sermon-list-post
margin: 0 0 20px
padding: 0 0 20px
.entry-header
margin: 0 0 10px

.entry-title-container
width: 60%

.entry-title
margin: 0px

.sermon-speaker-container
vertical-align: bottom

.sermon-info-container
.sermon-short-desc
float: left
width: 80%
.sermon-info
text-align: right
float: left
width: 20%

.sermon-series-listings
width: 100%

Expand Down
8 changes: 7 additions & 1 deletion themes/scacseattle.org/single-ct_sermon.php
Expand Up @@ -37,7 +37,13 @@
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', 'sermons', get_post_format() );
get_template_part( 'content', 'sermon', get_post_format() );
?>

<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template( '', true );
?>

<?php endwhile; ?>
Expand Down
20 changes: 20 additions & 0 deletions themes/scacseattle.org/style.css
Expand Up @@ -120,6 +120,7 @@
top: -7px; }

.flexslider {
min-height: 300px;
border: 0px;
overflow: hidden;
margin: 30px 0 30px 0; }
Expand Down Expand Up @@ -213,6 +214,25 @@
font-size: 16px;
font-weight: normal; }

.sermon-list-post {
margin: 0 0 20px;
padding: 0 0 20px; }
.sermon-list-post .entry-header {
margin: 0 0 10px; }
.sermon-list-post .entry-title-container {
width: 60%; }
.sermon-list-post .entry-title-container .entry-title {
margin: 0px; }
.sermon-list-post .sermon-speaker-container {
vertical-align: bottom; }
.sermon-list-post .sermon-info-container .sermon-short-desc {
float: left;
width: 80%; }
.sermon-list-post .sermon-info-container .sermon-info {
text-align: right;
float: left;
width: 20%; }

.sermon-series-listings {
width: 100%; }
.sermon-series-listings td {
Expand Down

0 comments on commit 6ac9001

Please sign in to comment.