Dashboard
PHP:
8.1.33
OS:
Linux
User:
lawtemple
/
/
home
/
www
/
lawtemplefirm.com
/
wp-content
/
themes
/
law-temple-theme
๐ค Upload
๐ New File
๐ New Folder
Close
Editing: single-insight.php
<?php get_header();while(have_posts()):the_post();$id=get_the_ID(); ?><main id="main-content"><section class="lt-page-hero"><div class="lt-container"><?php lt_theme_breadcrumbs(); ?><div class="lt-kicker"><?php $types=wp_get_post_terms($id,'insight_type');echo esc_html(!is_wp_error($types)&&$types?$types[0]->name:__('Insight','law-temple-theme')); ?></div><h1><?php the_title(); ?></h1><?php if(get_post_meta($id,'lt_subtitle',true)): ?><p class="lt-lead"><?php echo esc_html(get_post_meta($id,'lt_subtitle',true)); ?></p><?php endif; ?><p><?php echo esc_html(get_the_date()); ?><?php $mins=absint(get_post_meta($id,'lt_reading_time',true));if(!$mins)$mins=max(1,(int)ceil(str_word_count(wp_strip_all_tags(get_the_content()))/220)); ?> ยท <?php printf(esc_html__('%d min read','law-temple-theme'),$mins); ?></p></div></section><section class="lt-section"><div class="lt-container lt-content"><article class="lt-prose"><?php the_content(); ?></article><?php lt_theme_social_share(); ?><?php $pdf=absint(get_post_meta($id,'lt_pdf_id',true));if($pdf): ?><p><a class="lt-button lt-button--outline" href="<?php echo esc_url(wp_get_attachment_url($pdf)); ?>" download><?php esc_html_e('Download publication','law-temple-theme'); ?></a></p><?php endif; ?></div></section><?php $lawyers=function_exists('lt_core_get_related_posts')?lt_core_get_related_posts($id,'lt_lawyer_ids','lawyer'):array();if($lawyers): ?><section class="lt-section lt-section--surface"><div class="lt-container"><h2><?php esc_html_e('Authors','law-temple-theme'); ?></h2><div class="lt-grid" style="--lt-columns:4"><?php foreach($lawyers as $p): ?><a class="lt-card" href="<?php echo esc_url(get_permalink($p)); ?>"><h3><?php echo esc_html($p->post_title); ?></h3><p><?php echo esc_html(get_post_meta($p->ID,'lt_role',true)); ?></p></a><?php endforeach; ?></div></div></section><?php endif; ?> <?php $practices=function_exists('lt_core_get_related_posts')?lt_core_get_related_posts($id,'lt_practice_ids','practice'):array();if($practices): ?><section class="lt-section"><div class="lt-container"><h2><?php esc_html_e('Related expertise','law-temple-theme'); ?></h2><div class="lt-grid"><?php foreach($practices as $p): ?><a class="lt-card" href="<?php echo esc_url(get_permalink($p)); ?>"><h3><?php echo esc_html($p->post_title); ?></h3><?php if(has_excerpt($p)): ?><p><?php echo esc_html(get_the_excerpt($p)); ?></p><?php endif; ?></a><?php endforeach; ?></div></div></section><?php endif; ?> <?php $related=lt_theme_related_insights_for_insight($id,3);if($related): ?><section class="lt-section lt-section--surface"><div class="lt-container"><h2><?php esc_html_e('Related insights','law-temple-theme'); ?></h2><div class="lt-grid"><?php foreach($related as $p): ?><article class="lt-card"><h3><a href="<?php echo esc_url(get_permalink($p)); ?>"><?php echo esc_html($p->post_title); ?></a></h3><p><?php echo esc_html(get_the_excerpt($p)); ?></p></article><?php endforeach; ?></div></div></section><?php endif; ?> </main><?php endwhile;get_footer(); ?>
Save
Cancel