Skip to content

Commit

Permalink
Styling fixes when compatibility mode is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikola Miljković committed Mar 2, 2018
1 parent 4167dc7 commit 30c67a4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 37 deletions.
3 changes: 3 additions & 0 deletions assets/css/sermon.css
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ h3.wpfc_grid_title a {
background: white;
border: 1px solid #ddd;
}
.wpfc-sermon.noborder .wpfc-sermon-inner {
border: none;
}

.wpfc-sermon-main {
padding: 24px;
Expand Down
78 changes: 42 additions & 36 deletions includes/sm-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,49 +484,55 @@ function wpfc_sermon_excerpt_v2( $return = false ) {

ob_start();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="wpfc-sermon-inner">
<?php if ( get_sermon_image_url() ) : ?>
<div class="wpfc-sermon-image">
<a href="<?php the_permalink() ?>">
<div class="wpfc-sermon-image-img"
style="background-image: url(<?php echo get_sermon_image_url() ?>)"></div>
</a>
<?php if ( ! \SermonManager::getOption( 'theme_compatibility' ) ) : ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php endif; ?>
<div class="wpfc-sermon-inner">
<?php if ( get_sermon_image_url() ) : ?>
<div class="wpfc-sermon-image">
<a href="<?php the_permalink() ?>">
<div class="wpfc-sermon-image-img"
style="background-image: url(<?php echo get_sermon_image_url() ?>)"></div>
</a>
</div>
<?php endif; ?>
<div class="wpfc-sermon-main">
<?php if ( has_term( '', 'wpfc_sermon_series', $post->ID ) ) : ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-series">
<?php the_terms( $post->ID, 'wpfc_sermon_series' ) ?>
</div>
<?php endif; ?>
<div class="wpfc-sermon-main">
<?php if ( has_term( '', 'wpfc_sermon_series', $post->ID ) ) : ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-series">
<?php the_terms( $post->ID, 'wpfc_sermon_series' ) ?>
</div>
<?php endif; ?>
<?php if ( ! \SermonManager::getOption( 'theme_compatibility' ) ) : ?>
<h3 class="wpfc-sermon-title">
<a class="wpfc-sermon-title-text" href="<?php the_permalink() ?>"><?php the_title() ?></a>
</h3>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-date">
<?php sm_the_date() ?>
</div>
<div class="wpfc-sermon-description"><?php wpfc_sermon_description() ?></div>
<div class="wpfc-sermon-footer">
<?php if ( has_term( '', 'wpfc_preacher', $post->ID ) ) : ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-preacher">
<?php the_terms( $post->ID, 'wpfc_preacher' ) ?>
</div>
<?php endif; ?>
<?php if ( get_post_meta( $post->ID, 'bible_passage', true ) ) : ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-passage">
<?php wpfc_sermon_meta( 'bible_passage' ) ?>
</div>
<?php endif; ?>
<?php if ( has_term( '', 'wpfc_service_type', $post->ID ) ) : ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-service">
<?php the_terms( $post->ID, 'wpfc_service_type' ) ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-date">
<?php sm_the_date() ?>
</div>
<div class="wpfc-sermon-description"><?php wpfc_sermon_description() ?></div>
<div class="wpfc-sermon-footer">
<?php if ( has_term( '', 'wpfc_preacher', $post->ID ) ) : ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-preacher">
<?php the_terms( $post->ID, 'wpfc_preacher' ) ?>
</div>
<?php endif; ?>
<?php if ( get_post_meta( $post->ID, 'bible_passage', true ) ) : ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-passage">
<?php wpfc_sermon_meta( 'bible_passage' ) ?>
</div>
<?php endif; ?>
<?php if ( has_term( '', 'wpfc_service_type', $post->ID ) ) : ?>
<div class="wpfc-sermon-meta-item wpfc-sermon-meta-service">
<?php the_terms( $post->ID, 'wpfc_service_type' ) ?>
</div>
<?php endif; ?>
</div>
</div>
</article>
</div>
<?php if ( ! \SermonManager::getOption( 'theme_compatibility' ) ) : ?>
</article>
<?php endif; ?>

<?php

Expand Down
6 changes: 5 additions & 1 deletion sermons.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,10 @@ public static function add_additional_sermon_classes( $classes, $class, $post_id

if ( is_archive() ) {
$additional_classes[] = 'wpfc-sermon';

if ( \SermonManager::getOption( 'theme_compatibility' ) ) {
$additional_classes[] = 'noborder';
}
} else {
$additional_classes[] = 'wpfc-sermon-single';
}
Expand All @@ -637,7 +641,7 @@ public static function add_additional_sermon_classes( $classes, $class, $post_id
*/
$additional_classes = apply_filters( 'wpfc_sermon_classes', $additional_classes, $classes, $post_id );

return $additional_classes + $classes;
return array_merge( $additional_classes, $classes );
}

/**
Expand Down

0 comments on commit 30c67a4

Please sign in to comment.