/
var
/
www
/
barefootlaw.org
/
wp-content
/
themes
/
barefoot
/
template-parts
/
main
/
Upload File
HOME
<?php /** * The default template for displaying content * * Used for both index. * * @package Aisconverse * @subpackage Covercase * @since Covercase 1.0 */ ?> <?php // Default post classes & styles $post_classes = array('col-12'); $post_style = array(); $title = get_the_title(); // Current post Title $post_id = get_the_ID(); // Current post ID $format = get_post_format() === false ? 'standard' : get_post_format(); // Current post Format // Get current template name $template_name = basement_get_template_name(); // Apply default CSS styles/Classes if Template = classic (those. reset `$template_name`) $template_name = 'page-blog-classic' === $template_name ? '' : $template_name; // Check if post sticky $is_sticky = false; if ( is_sticky( $post_id ) && basement_is_blog_grid() ) { $is_sticky = true; } // Check if thumbnail exist $is_thumbnail = false; $thumbnail = get_the_post_thumbnail_url( null, 'full' ); if ( has_post_thumbnail() && ! post_password_required() && ! is_attachment() && ! empty( $thumbnail ) ) { $is_thumbnail = true; } // Time tag as link if title missed if ( empty( $title ) ) { $post_classes[] = 'post--time-linked'; } // If post is single if ( is_single() ) { $post_classes = array('post--singled'); } // Added sticky class if post sticky if ( $is_sticky ) { $post_classes[] = 'post--sticky post--light post--center'; $post_classes = explode(' ', str_replace('col-12','row align-items-center',implode( ' ', $post_classes ) ) ); $post_style[] = $is_thumbnail ? 'background-image:url('.esc_url($thumbnail).');' : ''; } // Modification of the post depending on the Blog template (only for main grid) if(!$is_sticky) { $find = $replace = ''; switch ( $template_name ) { case 'page-blog-vertical-boxed-light': $find = 'col-12'; $replace = 'col-md-6 col-xl-4 post--center'; break; case 'page-blog-vertical-boxed-dark': $find = 'col-12'; $replace = 'col-md-6 col-xl-4 post--center post--light-easy'; break; case 'page-blog-vertical-fullwidth-light': $find = 'col-12'; $replace = 'post--center'; break; case 'page-blog-vertical-fullwidth-dark': $find = 'col-12'; $replace = 'post--center post--light-easy'; break; case 'page-blog-horizontal-fullwidth-light': $find = 'col-12'; $replace = 'post--horizontal'; break; case 'page-blog-horizontal-fullwidth-dark': $find = 'col-12'; $replace = 'post--horizontal post--light-easy'; break; case 'page-blog-simple-boxed-light' : $find = 'col-12'; $replace = 'col-md-6 col-xl-4 post--simple'; break; case 'page-blog-simple-fullwidth-light' : $find = 'col-12'; $replace = 'col-md-6 col-lg-4 col-xl-3 post--simple'; break; case 'page-blog-simple-boxed-dark' : $find = 'col-12'; $replace = 'col-md-6 col-xl-4 post--simple post--light-easy'; break; case 'page-blog-simple-fullwidth-dark' : $find = 'col-12'; $replace = 'col-md-6 col-lg-4 col-xl-3 post--simple post--light-easy'; break; } $post_classes = explode(' ', str_replace($find,$replace,implode( ' ', $post_classes ) ) ); } ?> <article id="post-<?php the_ID(); ?>" <?php post_class( implode( ' ', $post_classes ) ); ?>> <?php if($is_sticky ) { echo '<div class="post-thumbnail" style="'.implode( ' ', $post_style ).'" ></div><div class="col-12">'; } ?> <div class="post-entry"> <?php if ( '' !== get_the_post_thumbnail() && ! is_single() && empty($template_name) ) { // Thumbnail for classic Blog grid `horizontal post under post` ?> <div class="post-entry__thumbnail"> <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr($title); ?>"><?php the_post_thumbnail(); ?></a> </div> <?php } ?> <?php if(!empty($template_name)) { ?> <div class="post-entry__thumbnail post-entry__thumbnail--bg <?php echo !$is_thumbnail ? 'post-entry__thumbnail--empty post-entry__thumbnail--static' : ''; ?>"> <?php $style_thumb = $is_thumbnail ? 'style="background-image: url('.esc_url($thumbnail).')"' : ''; ?> <a target="_blank" href="<?php the_permalink(); ?>" title="<?php echo esc_attr($title); ?>"><span <?php printf('%s', $style_thumb); ?> ></span></a> </div> <?php } ?> <div class="post-entry__body"> <!-- <div class="post-entry__meta"> <div class="post-entry__categories"><?php the_category('<ins>—</ins>'); ?></div> <div class="post-entry__comments"><?php covercase_comments(); ?></div> </div> --> <div class="post-entry__title"><?php the_title( '<h3 style="text-transform:uppercase;"><a target="_blank" href="' . esc_url( get_permalink() ) . '" rel="bookmark" title="'.esc_attr($title).'">', '</a></h3>' ); ?></div> <!-- <div class="post-entry__content"> <?php if ( has_excerpt() ) { the_excerpt(); } else { // Clear All VC tags (if more tag insert in VC content) $content = get_the_content(); $content = preg_replace( '/\[\\/?vc_(.*?)\]/', '', $content ); $content = apply_filters( 'the_content', $content ); $content = str_replace( ']]>', ']]>', $content ); printf('%s', $content); } ?> </div> <div class="post-entry__info"><?php echo get_the_author_posts_link(); ?><ins>—</ins><?php covercase_entry_date(); ?></div> --> <?php edit_post_link( __( 'Edit', 'covercase' ), '<div class="post-entry__edit">', '</div>' ); ?> </div> </div> <?php if($is_sticky) { echo '</div>'; } ?> </article><!-- #post-## -->