<?php
get_header();while(have_posts()):the_post();
$id=get_the_ID();$sections=array_filter(array_map('sanitize_key',explode(',',lt_theme_option('practice_order'))));$disabled=array_filter(array_map('sanitize_key',explode(',',lt_theme_option('practice_disabled'))));$layout=sanitize_html_class(lt_theme_option('practice_single_layout','editorial'));$intro=get_post_meta($id,'lt_intro',true);
?>
<main id="main-content" class="lt-practice-page lt-practice-page--<?php echo esc_attr($layout); ?> <?php echo esc_attr(lt_theme_content_width_class('practice')); ?>">
<section class="lt-page-hero"><div class="lt-container lt-page-hero__grid"><div><?php lt_theme_breadcrumbs(); ?><div class="lt-kicker"><?php esc_html_e('Practice Area','law-temple-theme'); ?></div><h1><?php the_title(); ?></h1><?php if($intro): ?><p class="lt-lead"><?php echo esc_html($intro); ?></p><?php endif; ?></div><?php if(lt_theme_option('practice_show_image')&&has_post_thumbnail()): ?><div class="lt-page-hero__image"><?php the_post_thumbnail('lt-card',array('loading'=>'eager','fetchpriority'=>'high')); ?></div><?php endif; ?></div></section>
<?php if('sidebar'===$layout||lt_theme_option('practice_sticky_summary')): ?><div class="lt-container lt-practice-shell"><aside class="lt-practice-summary"><div class="lt-kicker"><?php esc_html_e('On this page','law-temple-theme'); ?></div><?php foreach($sections as $s){if(in_array($s,$disabled,true)||'hero'===$s)continue;echo '<a href="#practice-'.esc_attr($s).'">'.esc_html(ucwords(str_replace('-',' ',$s))).'</a>';} ?></aside><div class="lt-practice-main"><?php foreach($sections as $s){if(in_array($s,$disabled,true)||'hero'===$s)continue;lt_theme_render_practice_section($s,$id);} ?></div></div><?php else: ?><?php foreach($sections as $s){if(in_array($s,$disabled,true)||'hero'===$s)continue;lt_theme_render_practice_section($s,$id);} ?><?php endif; ?>
</main><?php endwhile;get_footer(); ?>
