1 | <?php |
||
2 | /** |
||
3 | * Template used to display post content on single pages. |
||
4 | * |
||
5 | * @package lsx-health-plan |
||
6 | */ |
||
7 | global $group_name, $connected_workouts, $shortcode_args; |
||
8 | |||
9 | $warm_up = get_post_meta( get_the_ID(), 'plan_warmup', true ); |
||
10 | if ( false === $warm_up || '' === $warm_up ) { |
||
11 | $options = \lsx_health_plan\functions\get_option( 'all' ); |
||
12 | if ( isset( $options['plan_warmup'] ) && '' !== $options['plan_warmup'] && ! empty( $options['plan_warmup'] ) ) { |
||
13 | $warm_up = $options['plan_warmup']; |
||
14 | } |
||
15 | } |
||
16 | |||
17 | ?> |
||
18 | <div class="warmup-container"> |
||
19 | <?php |
||
20 | |||
21 | if ( false !== $warm_up && '' !== $warm_up ) { |
||
22 | if ( ! is_array( $warm_up ) ) { |
||
23 | $warm_up = array( $warm_up ); |
||
24 | } |
||
25 | |||
26 | $warmup_type = array( 'page', 'workout', 'exercise' ); |
||
27 | $warmup_query = new WP_Query( |
||
28 | array( |
||
29 | 'post__in' => $warm_up, |
||
30 | 'post_type' => $warmup_type, |
||
31 | ) |
||
32 | ); |
||
33 | |||
34 | if ( $warmup_query->have_posts() ) { |
||
35 | while ( $warmup_query->have_posts() ) { |
||
36 | $warmup_query->the_post(); |
||
37 | lsx_entry_before(); |
||
38 | if ( 'workout' === get_post_type() ) { |
||
39 | $connected_workouts = array( get_the_ID() ); |
||
40 | ?> |
||
41 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
||
42 | <?php lsx_entry_top(); ?> |
||
43 | <div class="entry-content"> |
||
44 | <div class="single-plan-inner warmup-content"> |
||
45 | <div class="single-plan-section-title warmup-plan title-lined"> |
||
46 | <?php lsx_get_svg_icon( 'warm.svg' ); ?> |
||
47 | <h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2> |
||
48 | </div> |
||
49 | </div> |
||
50 | </div><!-- .entry-content --> |
||
51 | <?php lsx_entry_bottom(); ?> |
||
52 | </article><!-- #post-## --> |
||
53 | <?php |
||
54 | lsx_health_plan_warmup_sets( $connected_workouts ); |
||
55 | } else { |
||
56 | ?> |
||
57 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
||
58 | <?php lsx_entry_top(); ?> |
||
59 | <div class="entry-content"> |
||
60 | <div class="single-plan-inner warmup-content"> |
||
61 | <div class="single-plan-section-title warmup-plan title-lined"> |
||
62 | <?php lsx_get_svg_icon( 'warm.svg' ); ?> |
||
63 | <h2><?php esc_html_e( 'Warm Up', 'lsx-health-plan' ); ?></h2> |
||
64 | </div> |
||
65 | <?php |
||
66 | the_content(); |
||
67 | wp_link_pages( array( |
||
68 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
||
69 | 'after' => '</div></div>', |
||
70 | 'link_before' => '<span>', |
||
71 | 'link_after' => '</span>', |
||
72 | ) ); |
||
73 | ?> |
||
74 | </div> |
||
75 | </div><!-- .entry-content --> |
||
76 | <?php lsx_entry_bottom(); ?> |
||
77 | </article><!-- #post-## --> |
||
78 | <?php |
||
79 | } |
||
80 | |||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
81 | } |
||
82 | wp_reset_postdata(); |
||
83 | } |
||
84 | } |
||
85 | ?> |
||
86 | </div> |
||
87 | <?php |
||
88 |