-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.php
More file actions
45 lines (32 loc) · 958 Bytes
/
Copy pathpage.php
File metadata and controls
45 lines (32 loc) · 958 Bytes
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
45
<?php
/**
* The template for displaying pages
*
* @package WM_Base_Theme
*/
get_header();
?>
<main id="main-content" class="site-main">
<?php while ( have_posts() ) : the_post(); ?>
<?php
// Use ACF page builder if active and has layouts, otherwise fall back to block/classic content.
$has_page_builder = wm_acf_is_active() && have_rows( 'page_builder' );
?>
<?php if ( $has_page_builder ) : ?>
<?php while ( have_rows( 'page_builder' ) ) : the_row(); ?>
<?php
$layout = get_row_layout();
$template = WM_THEME_PATH . '/src/templates/acf-layouts/' . $layout . '.php';
if ( file_exists( $template ) ) {
include $template;
}
?>
<?php endwhile; ?>
<?php else : ?>
<div class="container">
<?php get_template_part( 'src/templates/content', 'page' ); ?>
</div>
<?php endif; ?>
<?php endwhile; ?>
</main>
<?php get_footer();