Skip to content

Instantly share code, notes, and snippets.

@TanvirAmi
Created September 21, 2022 11:29
Show Gist options
  • Save TanvirAmi/377ef1c957faea4b33d7e0c9c7b5b6f5 to your computer and use it in GitHub Desktop.
Save TanvirAmi/377ef1c957faea4b33d7e0c9c7b5b6f5 to your computer and use it in GitHub Desktop.
<?php
/**
* Partial Template for Single Post "Modern Layout" - called from single.php
*/
$props = array_replace(
[
'layout' => 'modern-a',
'header_outer' => false,
'centered' => false,
'cat_style' => Bunyad::options()->post_meta_single_cat_labels,
'post_classes' => [],
'has_large_bot' => false,
'social_top_style' => Bunyad::options()->single_share_top_style,
'featured_in_head' => false,
'classes' => [],
],
isset($props) ? $props : []
);
?>
<?php if ($props['header_outer']): ?>
<?php Bunyad::core()->partial('partials/single/modern-header', $props); ?>
<?php endif; ?>
<div class="col-12">
<?php if (!$props['header_outer']): ?>
<?php Bunyad::core()->partial('partials/single/modern-header', $props); ?>
<?php endif; ?>
</div>
<div class="ts-row<?php echo esc_attr($props['has_large_bot'] ? ' has-s-large-bot' : ''); ?>">
<div class="col-8 main-content">
<?php if (!$props['featured_in_head']): ?>
<div class="single-featured">
<?php
Bunyad::core()->partial('partials/single/featured', $props);
?>
</div>
<?php endif; ?>
<div <?php Bunyad::markup()->attribs('the-post-wrap', [
'class' => $props['post_classes']
]); ?>>
<article id="post-<?php the_ID(); ?>" class="<?php echo esc_attr(join(' ', get_post_class())); ?>">
<?php
// Get post body content.
get_template_part('partials/single/post-content');
?>
</article>
<?php
// Add author box.
do_action('bunyad_author_box_before');
get_template_part('partials/single/author-box');
do_action('bunyad_author_box_after');
?>
</div>
</div>
<?php Bunyad::core()->theme_sidebar(); ?>
</div>
<div class="ts-row">
<div <?php Bunyad::markup()->attribs('the-post-wrap', [
'class' => $props['post_classes']
]); ?>>
<?php Bunyad::core()->partial('partials/single/post-footer'); ?>
<div class="comments">
<?php comments_template('', true); ?>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment