1 | <?php |
||
2 | /** |
||
3 | * Template used to display post content on single pages. |
||
4 | * |
||
5 | * @package lsx-health-plan |
||
6 | */ |
||
7 | |||
8 | // Getting translated endpoint. |
||
9 | |||
10 | $archive_meals = \lsx_health_plan\functions\get_option( 'endpoint_meal_archive', 'meals' ); |
||
11 | $meal = \lsx_health_plan\functions\get_option( 'endpoint_meal', 'meal' ); |
||
12 | |||
13 | $connected_members = get_post_meta( get_the_ID(), ( $meal . '_connected_team_member' ), true ); |
||
14 | $connected_articles = get_post_meta( get_the_ID(), ( $meal . '_connected_articles' ), true ); |
||
15 | |||
16 | ?> |
||
17 | |||
18 | <?php lsx_entry_before(); ?> |
||
19 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
||
20 | <?php lsx_entry_top(); ?> |
||
21 | |||
22 | <div class="entry-meta"> |
||
23 | <?php lsx_post_meta_single_bottom(); ?> |
||
24 | </div><!-- .entry-meta --> |
||
25 | |||
26 | <div class="entry-content"> |
||
27 | <div class="single-plan-inner meal-content"> |
||
28 | <?php |
||
29 | if ( is_singular( 'meal' ) ) { ?> |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
30 | <div class="single-plan-section-title meal-plan title-lined"> |
||
31 | <?php lsx_get_svg_icon( 'meal.svg' ); ?> |
||
32 | <h2><?php the_title(); ?></h2> |
||
33 | <?php if ( class_exists( 'LSX_Sharing' ) ) { |
||
0 ignored issues
–
show
|
|||
34 | lsx_content_sharing(); |
||
35 | } ?> |
||
0 ignored issues
–
show
|
|||
36 | </div> |
||
37 | <?php } else { ?> |
||
38 | <div class="single-plan-section-title meal-plan title-lined"> |
||
39 | <?php lsx_get_svg_icon( 'meal.svg' ); ?> |
||
40 | <h2><?php esc_html_e( 'My Meal Plan', 'lsx-health-plan' ); ?> <?php the_title(); ?></h2> |
||
41 | </div> |
||
42 | <?php } ?> |
||
43 | |||
44 | <?php require LSX_HEALTH_PLAN_PATH . 'templates/partials/meal-plans.php'; ?> |
||
45 | </div> |
||
46 | |||
47 | </div><!-- .entry-content --> |
||
48 | <?php lsx_entry_bottom(); ?> |
||
49 | |||
50 | </article><!-- #post-## --> |
||
51 | |||
52 | <div class="back-plan-btn"> |
||
53 | <?php if ( is_single() && is_singular( 'meal' ) ) { ?> |
||
0 ignored issues
–
show
|
|||
54 | <a class="btn border-btn" href="/<?php echo $archive_meals; ?>"><?php esc_html_e( 'Back to meals', 'lsx-health-plan' ); ?></a> |
||
55 | <?php } ?> |
||
56 | |||
57 | <?php |
||
58 | // Shoping list |
||
0 ignored issues
–
show
|
|||
59 | $shopping_list = get_post_meta( get_the_ID(), 'meal_shopping_list', true ); |
||
60 | if ( ! empty( $shopping_list ) ) { |
||
0 ignored issues
–
show
|
|||
61 | ?> |
||
62 | <a class="btn border-btn btn-shopping" href="<?php echo esc_url( get_page_link( $shopping_list ) ); ?>" target="_blank"><?php esc_html_e( 'Download Shopping List', 'lsx-health-plan' ); ?><i class="fa fa-download" aria-hidden="true"></i></a> |
||
63 | <?php |
||
64 | } |
||
65 | |||
66 | ?> |
||
67 | </div> |
||
68 | |||
69 | <?php |
||
70 | if ( ! empty( $connected_articles ) ) { |
||
0 ignored issues
–
show
|
|||
71 | lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
||
72 | } |
||
73 |