-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
44 lines (32 loc) · 1.45 KB
/
single.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
get_header();
global $more; ?>
<main id="<?php abbey_theme_page_id(); ?>" class="row">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php $more = 0; ?>
<header id="site-content-header"><?php do_action( "abbey_theme_before_post_content" ); ?></header>
<!-- set of conditions on which template file should be selected to display the post
all template files are found in templates folder
1. if its a custom post type e.g. news, reviews, check if there is a content-{post-type} e.g. content-news.php
2. if it doesnt have a post format and its a normal post, use content-post.php
3. if the post has a post format i.e. quote, gallery, use content-{post-format} e.g content-quote.php
-->
<?php if( ! has_post_format() ) : ?>
<?php
if( locate_template( "templates/content-".get_post_type().".php" ) )
get_template_part("templates/content", get_post_type() );
else
get_template_part( "templates/content", "post" );
?>
<?php else: ?>
<?php get_template_part("templates/content", get_post_format() ); ?>
<?php endif; ?>
<?php endwhile; //end of loop //?>
<?php else : get_template_part("templates/content", "none"); ?>
<?php endif; //end if have_posts() // ?>
<aside class="col-md-4 col-md-offset-1 sidebar" role="complimentary" id="primary-sidebar">
<?php abbey_display_sidebar( "sidebar-main" ); ?>
</aside>
</main> <?php
get_footer();