@@ -32,37 +32,37 @@ |
||
| 32 | 32 | |
| 33 | 33 | <div class="entry-content"> |
| 34 | 34 | <?php |
| 35 | - if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) { |
|
| 36 | - $classes = get_body_class(); |
|
| 37 | - if ( in_array( 'has-block-banner', $classes ) ) { |
|
| 38 | - $blocks = parse_blocks( get_the_content() ); |
|
| 39 | - foreach ( $blocks as $block ) { |
|
| 40 | - if ( 'lsx-blocks/lsx-banner-box' === $block['blockName'] ) { |
|
| 41 | - echo wp_kses_post( $block['innerHTML'] ); |
|
| 42 | - } |
|
| 43 | - } |
|
| 44 | - } elseif ( in_array( 'has-block-cover', $classes ) ) { |
|
| 45 | - $blocks = parse_blocks( get_the_content() ); |
|
| 46 | - foreach ( $blocks as $block ) { |
|
| 47 | - //print( '<pre>' . print_r( $block, true ) . '</pre>' ); |
|
| 48 | - if ( 'core/cover' === $block['blockName'] ) { |
|
| 49 | - echo wp_kses_post( render_block( $block ) ); |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - } else { |
|
| 53 | - $my_plan_string = esc_html__( 'My Plan', 'lsx-health-plan' ); |
|
| 54 | - echo wp_kses_post( '<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>' ); |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - $my_profile_string = esc_html__( 'My Profile', 'lsx-health-plan' ); |
|
| 58 | - $my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' ); |
|
| 59 | - echo do_shortcode( '<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>' ); |
|
| 60 | - } else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) { |
|
| 61 | - echo do_shortcode( '[woocommerce_my_account]' ); |
|
| 62 | - } else { |
|
| 63 | - the_content(); |
|
| 64 | - } |
|
| 65 | - ?> |
|
| 35 | + if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) { |
|
| 36 | + $classes = get_body_class(); |
|
| 37 | + if ( in_array( 'has-block-banner', $classes ) ) { |
|
| 38 | + $blocks = parse_blocks( get_the_content() ); |
|
| 39 | + foreach ( $blocks as $block ) { |
|
| 40 | + if ( 'lsx-blocks/lsx-banner-box' === $block['blockName'] ) { |
|
| 41 | + echo wp_kses_post( $block['innerHTML'] ); |
|
| 42 | + } |
|
| 43 | + } |
|
| 44 | + } elseif ( in_array( 'has-block-cover', $classes ) ) { |
|
| 45 | + $blocks = parse_blocks( get_the_content() ); |
|
| 46 | + foreach ( $blocks as $block ) { |
|
| 47 | + //print( '<pre>' . print_r( $block, true ) . '</pre>' ); |
|
| 48 | + if ( 'core/cover' === $block['blockName'] ) { |
|
| 49 | + echo wp_kses_post( render_block( $block ) ); |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + } else { |
|
| 53 | + $my_plan_string = esc_html__( 'My Plan', 'lsx-health-plan' ); |
|
| 54 | + echo wp_kses_post( '<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>' ); |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + $my_profile_string = esc_html__( 'My Profile', 'lsx-health-plan' ); |
|
| 58 | + $my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' ); |
|
| 59 | + echo do_shortcode( '<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>' ); |
|
| 60 | + } else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) { |
|
| 61 | + echo do_shortcode( '[woocommerce_my_account]' ); |
|
| 62 | + } else { |
|
| 63 | + the_content(); |
|
| 64 | + } |
|
| 65 | + ?> |
|
| 66 | 66 | </div><!-- .entry-content --> |
| 67 | 67 | |
| 68 | 68 | <?php lsx_entry_bottom(); ?> |
@@ -22,15 +22,15 @@ |
||
| 22 | 22 | <div class="entry-content"> |
| 23 | 23 | <div class="overview"> |
| 24 | 24 | <?php |
| 25 | - the_content(); |
|
| 26 | - |
|
| 27 | - wp_link_pages( array( |
|
| 28 | - 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
| 29 | - 'after' => '</div></div>', |
|
| 30 | - 'link_before' => '<span>', |
|
| 31 | - 'link_after' => '</span>', |
|
| 32 | - ) ); |
|
| 33 | - ?> |
|
| 25 | + the_content(); |
|
| 26 | + |
|
| 27 | + wp_link_pages( array( |
|
| 28 | + 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
| 29 | + 'after' => '</div></div>', |
|
| 30 | + 'link_before' => '<span>', |
|
| 31 | + 'link_after' => '</span>', |
|
| 32 | + ) ); |
|
| 33 | + ?> |
|
| 34 | 34 | </div> |
| 35 | 35 | </div><!-- .entry-content --> |
| 36 | 36 | <?php if ( null === $shortcode_args ) { ?> |
@@ -22,9 +22,9 @@ |
||
| 22 | 22 | <div class="post-wrapper"> |
| 23 | 23 | |
| 24 | 24 | <?php |
| 25 | - while ( have_posts() ) : |
|
| 26 | - the_post(); |
|
| 27 | - ?> |
|
| 25 | + while ( have_posts() ) : |
|
| 26 | + the_post(); |
|
| 27 | + ?> |
|
| 28 | 28 | <div class="meal-content"> |
| 29 | 29 | <?php the_content(); ?> |
| 30 | 30 | </div> |
@@ -22,9 +22,9 @@ |
||
| 22 | 22 | <div class="post-wrapper"> |
| 23 | 23 | |
| 24 | 24 | <?php |
| 25 | - while ( have_posts() ) : |
|
| 26 | - the_post(); |
|
| 27 | - ?> |
|
| 25 | + while ( have_posts() ) : |
|
| 26 | + the_post(); |
|
| 27 | + ?> |
|
| 28 | 28 | <?php include LSX_HEALTH_PLAN_PATH . '/templates/tab-content-workout.php'; ?> |
| 29 | 29 | |
| 30 | 30 | <?php endwhile; ?> |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | global $group_name,$shortcode_args; |
| 9 | 9 | $groups = get_post_meta( get_the_ID(), $group_name, true ); |
| 10 | 10 | if ( is_singular( 'workout' ) ) { |
| 11 | - $groups = get_post_meta( get_queried_object_id(), $group_name, true ); |
|
| 11 | + $groups = get_post_meta( get_queried_object_id(), $group_name, true ); |
|
| 12 | 12 | } |
| 13 | 13 | $link_setting = \lsx_health_plan\functions\get_option( 'workout_tab_link', 'single' ); |
| 14 | 14 | $content_setting = \lsx_health_plan\functions\get_option( 'workout_tab_content', '' ); |
@@ -16,113 +16,113 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | // Check for shortcode overrides. |
| 18 | 18 | if ( null !== $shortcode_args ) { |
| 19 | - if ( isset( $shortcode_args['link'] ) ) { |
|
| 20 | - $link_setting = $shortcode_args['link']; |
|
| 21 | - } |
|
| 22 | - if ( isset( $shortcode_args['description'] ) ) { |
|
| 23 | - $content_setting = $shortcode_args['description']; |
|
| 24 | - } |
|
| 25 | - if ( isset( $shortcode_args['modal_content'] ) ) { |
|
| 26 | - $modal_content_setting = $shortcode_args['modal_content']; |
|
| 27 | - } |
|
| 19 | + if ( isset( $shortcode_args['link'] ) ) { |
|
| 20 | + $link_setting = $shortcode_args['link']; |
|
| 21 | + } |
|
| 22 | + if ( isset( $shortcode_args['description'] ) ) { |
|
| 23 | + $content_setting = $shortcode_args['description']; |
|
| 24 | + } |
|
| 25 | + if ( isset( $shortcode_args['modal_content'] ) ) { |
|
| 26 | + $modal_content_setting = $shortcode_args['modal_content']; |
|
| 27 | + } |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $modal_args = array( |
| 31 | - 'modal_content' => $modal_content_setting, |
|
| 31 | + 'modal_content' => $modal_content_setting, |
|
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | 34 | if ( ! empty( $groups ) ) { |
| 35 | - ?> |
|
| 35 | + ?> |
|
| 36 | 36 | <div class="set-list"> |
| 37 | 37 | <div class="workout-list"> |
| 38 | 38 | <?php |
| 39 | - foreach ( $groups as $group ) { |
|
| 39 | + foreach ( $groups as $group ) { |
|
| 40 | 40 | |
| 41 | - $connected_exercise = false; |
|
| 42 | - if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) { |
|
| 43 | - $connected_exercise = true; |
|
| 44 | - } |
|
| 41 | + $connected_exercise = false; |
|
| 42 | + if ( isset( $group['connected_exercises'] ) && '' !== $group['connected_exercises'] ) { |
|
| 43 | + $connected_exercise = true; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - if ( ( $connected_exercise ) || ( ( ! $connected_exercise ) && '' !== $group['alt_title'] && isset( $group['alt_title'] ) ) ) { |
|
| 46 | + if ( ( $connected_exercise ) || ( ( ! $connected_exercise ) && '' !== $group['alt_title'] && isset( $group['alt_title'] ) ) ) { |
|
| 47 | 47 | |
| 48 | - $alt_title = ''; |
|
| 49 | - if ( isset( $group['alt_title'] ) && '' !== $group['alt_title'] ) { |
|
| 50 | - $alt_title = '<span class="alt-title">' . esc_html( $group['alt_title'] ) . '</span>'; |
|
| 51 | - } |
|
| 48 | + $alt_title = ''; |
|
| 49 | + if ( isset( $group['alt_title'] ) && '' !== $group['alt_title'] ) { |
|
| 50 | + $alt_title = '<span class="alt-title">' . esc_html( $group['alt_title'] ) . '</span>'; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - $alt_description = ''; |
|
| 54 | - if ( isset( $group['alt_description'] ) && '' !== $group['alt_description'] ) { |
|
| 55 | - $alt_description = '<span class="alt-description">' . esc_html( $group['alt_description'] ) . '</span>'; |
|
| 56 | - } |
|
| 53 | + $alt_description = ''; |
|
| 54 | + if ( isset( $group['alt_description'] ) && '' !== $group['alt_description'] ) { |
|
| 55 | + $alt_description = '<span class="alt-description">' . esc_html( $group['alt_description'] ) . '</span>'; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - $alt_image = ''; |
|
| 59 | - if ( isset( $group['exercise_alt_thumbnail'] ) && '' !== $group['exercise_alt_thumbnail'] ) { |
|
| 60 | - $alt_image = $group['exercise_alt_thumbnail']; |
|
| 61 | - } |
|
| 58 | + $alt_image = ''; |
|
| 59 | + if ( isset( $group['exercise_alt_thumbnail'] ) && '' !== $group['exercise_alt_thumbnail'] ) { |
|
| 60 | + $alt_image = $group['exercise_alt_thumbnail']; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - $reps = ''; |
|
| 64 | - if ( isset( $group['reps'] ) && '' !== $group['reps'] ) { |
|
| 65 | - $reps = '<span class="reps">' . esc_html( $group['reps'] ) . '</span>'; |
|
| 66 | - } |
|
| 67 | - // Setup our link and content. |
|
| 68 | - switch ( $link_setting ) { |
|
| 69 | - case 'single': |
|
| 70 | - $link_html = ''; |
|
| 71 | - $link_close = ''; |
|
| 72 | - if ( $connected_exercise ) { |
|
| 73 | - $link_html = '<a href="' . get_permalink( $group['connected_exercises'] ) . '">'; |
|
| 74 | - $link_close = '</a>'; |
|
| 75 | - } |
|
| 76 | - break; |
|
| 63 | + $reps = ''; |
|
| 64 | + if ( isset( $group['reps'] ) && '' !== $group['reps'] ) { |
|
| 65 | + $reps = '<span class="reps">' . esc_html( $group['reps'] ) . '</span>'; |
|
| 66 | + } |
|
| 67 | + // Setup our link and content. |
|
| 68 | + switch ( $link_setting ) { |
|
| 69 | + case 'single': |
|
| 70 | + $link_html = ''; |
|
| 71 | + $link_close = ''; |
|
| 72 | + if ( $connected_exercise ) { |
|
| 73 | + $link_html = '<a href="' . get_permalink( $group['connected_exercises'] ) . '">'; |
|
| 74 | + $link_close = '</a>'; |
|
| 75 | + } |
|
| 76 | + break; |
|
| 77 | 77 | |
| 78 | - case 'modal': |
|
| 79 | - $link_html = ''; |
|
| 80 | - $link_close = ''; |
|
| 81 | - if ( $connected_exercise ) { |
|
| 82 | - if ( ( '' !== $alt_title ) || ( '' !== $alt_description ) || ( '' !== $alt_image ) ) { |
|
| 83 | - $link_html = '<a class="alt-modal" data-toggle="modal" href="#workout-alt-exercise-modal-' . $group['connected_exercises'] . '">'; |
|
| 84 | - $link_close = '</a>'; |
|
| 85 | - // We call the button to register the alt modal, but we do not output it. |
|
| 86 | - lsx_health_plan_workout_exercise_alt_button( $group['connected_exercises'], $group, false, $modal_args, $alt_title, $alt_description, $alt_image ); |
|
| 87 | - } else { |
|
| 88 | - $link_html = '<a data-toggle="modal" href="#workout-exercise-modal-' . $group['connected_exercises'] . '">'; |
|
| 89 | - $link_close = '</a>'; |
|
| 90 | - // We call the button to register the modal, but we do not output it. |
|
| 91 | - lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args ); |
|
| 92 | - } |
|
| 93 | - } |
|
| 94 | - break; |
|
| 78 | + case 'modal': |
|
| 79 | + $link_html = ''; |
|
| 80 | + $link_close = ''; |
|
| 81 | + if ( $connected_exercise ) { |
|
| 82 | + if ( ( '' !== $alt_title ) || ( '' !== $alt_description ) || ( '' !== $alt_image ) ) { |
|
| 83 | + $link_html = '<a class="alt-modal" data-toggle="modal" href="#workout-alt-exercise-modal-' . $group['connected_exercises'] . '">'; |
|
| 84 | + $link_close = '</a>'; |
|
| 85 | + // We call the button to register the alt modal, but we do not output it. |
|
| 86 | + lsx_health_plan_workout_exercise_alt_button( $group['connected_exercises'], $group, false, $modal_args, $alt_title, $alt_description, $alt_image ); |
|
| 87 | + } else { |
|
| 88 | + $link_html = '<a data-toggle="modal" href="#workout-exercise-modal-' . $group['connected_exercises'] . '">'; |
|
| 89 | + $link_close = '</a>'; |
|
| 90 | + // We call the button to register the modal, but we do not output it. |
|
| 91 | + lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args ); |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | + break; |
|
| 95 | 95 | |
| 96 | - case 'none': |
|
| 97 | - default: |
|
| 98 | - $link_html = ''; |
|
| 99 | - $link_close = ''; |
|
| 100 | - break; |
|
| 101 | - } |
|
| 102 | - ?> |
|
| 96 | + case 'none': |
|
| 97 | + default: |
|
| 98 | + $link_html = ''; |
|
| 99 | + $link_close = ''; |
|
| 100 | + break; |
|
| 101 | + } |
|
| 102 | + ?> |
|
| 103 | 103 | <article class="lsx-slot box-shadow"> |
| 104 | 104 | <div class="row"> |
| 105 | 105 | <div class="col-sm-6 col-md-2"> |
| 106 | 106 | <div class="exercise-feature-img"> |
| 107 | 107 | <?php echo wp_kses_post( $link_html ); ?> |
| 108 | 108 | <?php |
| 109 | - // We call the button to register the modal, but we do not output it. |
|
| 110 | - lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args ); |
|
| 111 | - $thumbnail_args = array( |
|
| 112 | - 'class' => 'aligncenter', |
|
| 113 | - ); |
|
| 114 | - $featured_image = get_the_post_thumbnail( $group['connected_exercises'], 'medium', $thumbnail_args ); |
|
| 115 | - if ( $alt_image ) { |
|
| 116 | - $featured_image = '<img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '">'; |
|
| 117 | - } |
|
| 118 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
| 119 | - echo wp_kses_post( $featured_image ); |
|
| 120 | - } else { |
|
| 121 | - ?> |
|
| 109 | + // We call the button to register the modal, but we do not output it. |
|
| 110 | + lsx_health_plan_workout_exercise_button( $group['connected_exercises'], $group, false, $modal_args ); |
|
| 111 | + $thumbnail_args = array( |
|
| 112 | + 'class' => 'aligncenter', |
|
| 113 | + ); |
|
| 114 | + $featured_image = get_the_post_thumbnail( $group['connected_exercises'], 'medium', $thumbnail_args ); |
|
| 115 | + if ( $alt_image ) { |
|
| 116 | + $featured_image = '<img alt="thumbnail" loading="lazy" class="aligncenter wp-post-image" src="' . $alt_image . '">'; |
|
| 117 | + } |
|
| 118 | + if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
| 119 | + echo wp_kses_post( $featured_image ); |
|
| 120 | + } else { |
|
| 121 | + ?> |
|
| 122 | 122 | <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
| 123 | 123 | <?php |
| 124 | - } |
|
| 125 | - ?> |
|
| 124 | + } |
|
| 125 | + ?> |
|
| 126 | 126 | <?php echo wp_kses_post( $link_close ); ?> |
| 127 | 127 | </div> |
| 128 | 128 | </div> |
@@ -131,15 +131,15 @@ discard block |
||
| 131 | 131 | <h3> |
| 132 | 132 | <?php echo wp_kses_post( $link_html ); ?> |
| 133 | 133 | <?php |
| 134 | - $exercise_title = lsx_health_plan_exercise_title( '', '', false, $group['connected_exercises'] ); |
|
| 135 | - if ( '' !== $alt_title ) { |
|
| 136 | - $exercise_title = $alt_title; |
|
| 137 | - } |
|
| 138 | - if ( '' !== $reps ) { |
|
| 139 | - $exercise_title .= $reps; |
|
| 140 | - } |
|
| 141 | - echo wp_kses_post( $exercise_title ); |
|
| 142 | - ?> |
|
| 134 | + $exercise_title = lsx_health_plan_exercise_title( '', '', false, $group['connected_exercises'] ); |
|
| 135 | + if ( '' !== $alt_title ) { |
|
| 136 | + $exercise_title = $alt_title; |
|
| 137 | + } |
|
| 138 | + if ( '' !== $reps ) { |
|
| 139 | + $exercise_title .= $reps; |
|
| 140 | + } |
|
| 141 | + echo wp_kses_post( $exercise_title ); |
|
| 142 | + ?> |
|
| 143 | 143 | <?php echo wp_kses_post( $link_close ); ?> |
| 144 | 144 | </h3> |
| 145 | 145 | </div> |
@@ -152,9 +152,9 @@ discard block |
||
| 152 | 152 | </div> |
| 153 | 153 | </article> |
| 154 | 154 | <?php |
| 155 | - } |
|
| 156 | - } |
|
| 157 | - ?> |
|
| 155 | + } |
|
| 156 | + } |
|
| 157 | + ?> |
|
| 158 | 158 | </div> |
| 159 | 159 | </div> |
| 160 | 160 | <?php |
@@ -8,56 +8,56 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | // Check for any shortcode overrides. |
| 10 | 10 | if ( null !== $shortcode_args && isset( $shortcode_args['include'] ) ) { |
| 11 | - $connected_workouts = array( get_the_ID() ); |
|
| 11 | + $connected_workouts = array( get_the_ID() ); |
|
| 12 | 12 | } |
| 13 | 13 | ?> |
| 14 | 14 | <div class="sets"> |
| 15 | 15 | <?php |
| 16 | - if ( empty( $connected_workouts ) || null === $connected_workouts ) { |
|
| 17 | - $connected_workouts = get_post_meta( get_the_ID(), 'connected_workouts', true ); |
|
| 18 | - if ( empty( $connected_workouts ) ) { |
|
| 19 | - $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
| 20 | - if ( isset( $options['connected_workouts'] ) && '' !== $options['connected_workouts'] && ! empty( $options['connected_workouts'] ) ) { |
|
| 21 | - $connected_workouts = $options['connected_workouts']; |
|
| 22 | - if ( ! array( $connected_workouts ) ) { |
|
| 23 | - $connected_workouts = array( $connected_workouts ); |
|
| 24 | - } |
|
| 25 | - } |
|
| 26 | - } |
|
| 27 | - } |
|
| 28 | - $args = array( |
|
| 29 | - 'orderby' => 'date', |
|
| 30 | - 'order' => 'DESC', |
|
| 31 | - 'post_type' => 'workout', |
|
| 32 | - 'post__in' => $connected_workouts, |
|
| 33 | - ); |
|
| 34 | - $workouts = new WP_Query( $args ); |
|
| 16 | + if ( empty( $connected_workouts ) || null === $connected_workouts ) { |
|
| 17 | + $connected_workouts = get_post_meta( get_the_ID(), 'connected_workouts', true ); |
|
| 18 | + if ( empty( $connected_workouts ) ) { |
|
| 19 | + $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
| 20 | + if ( isset( $options['connected_workouts'] ) && '' !== $options['connected_workouts'] && ! empty( $options['connected_workouts'] ) ) { |
|
| 21 | + $connected_workouts = $options['connected_workouts']; |
|
| 22 | + if ( ! array( $connected_workouts ) ) { |
|
| 23 | + $connected_workouts = array( $connected_workouts ); |
|
| 24 | + } |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | + } |
|
| 28 | + $args = array( |
|
| 29 | + 'orderby' => 'date', |
|
| 30 | + 'order' => 'DESC', |
|
| 31 | + 'post_type' => 'workout', |
|
| 32 | + 'post__in' => $connected_workouts, |
|
| 33 | + ); |
|
| 34 | + $workouts = new WP_Query( $args ); |
|
| 35 | 35 | |
| 36 | - if ( $workouts->have_posts() ) { |
|
| 37 | - while ( $workouts->have_posts() ) { |
|
| 38 | - $workouts->the_post(); |
|
| 39 | - // Brings the workout post content first. |
|
| 40 | - echo wp_kses_post( lsx_health_plan_workout_main_content() ); |
|
| 36 | + if ( $workouts->have_posts() ) { |
|
| 37 | + while ( $workouts->have_posts() ) { |
|
| 38 | + $workouts->the_post(); |
|
| 39 | + // Brings the workout post content first. |
|
| 40 | + echo wp_kses_post( lsx_health_plan_workout_main_content() ); |
|
| 41 | 41 | |
| 42 | - $i = 1; |
|
| 43 | - $section_counter = 6; |
|
| 44 | - while ( $i <= $section_counter ) { |
|
| 42 | + $i = 1; |
|
| 43 | + $section_counter = 6; |
|
| 44 | + while ( $i <= $section_counter ) { |
|
| 45 | 45 | |
| 46 | - $workout_section = 'workout_section_' . ( $i ) . '_title'; |
|
| 47 | - $workout_desc = 'workout_section_' . ( $i ) . '_description'; |
|
| 46 | + $workout_section = 'workout_section_' . ( $i ) . '_title'; |
|
| 47 | + $workout_desc = 'workout_section_' . ( $i ) . '_description'; |
|
| 48 | 48 | |
| 49 | - $section_title = get_post_meta( get_the_ID(), $workout_section, true ); |
|
| 50 | - $description = get_post_meta( get_the_ID(), $workout_desc, true ); |
|
| 51 | - if ( is_singular( 'workout' ) ) { |
|
| 52 | - $section_title = get_post_meta( get_queried_object_id(), $workout_section, true ); |
|
| 53 | - $description = get_post_meta( get_queried_object_id(), $workout_desc, true ); |
|
| 54 | - } |
|
| 49 | + $section_title = get_post_meta( get_the_ID(), $workout_section, true ); |
|
| 50 | + $description = get_post_meta( get_the_ID(), $workout_desc, true ); |
|
| 51 | + if ( is_singular( 'workout' ) ) { |
|
| 52 | + $section_title = get_post_meta( get_queried_object_id(), $workout_section, true ); |
|
| 53 | + $description = get_post_meta( get_queried_object_id(), $workout_desc, true ); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - if ( '' === $section_title ) { |
|
| 57 | - $i++; |
|
| 58 | - continue; |
|
| 59 | - } |
|
| 60 | - ?> |
|
| 56 | + if ( '' === $section_title ) { |
|
| 57 | + $i++; |
|
| 58 | + continue; |
|
| 59 | + } |
|
| 60 | + ?> |
|
| 61 | 61 | <div class="set-box set content-box"> |
| 62 | 62 | <h3 class="set-title"><?php echo esc_html( $section_title ); ?></h3> |
| 63 | 63 | <div class="set-content"> |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | <?php lsx_health_plan_workout_tab_content( $i ); ?> |
| 67 | 67 | </div> |
| 68 | 68 | <?php |
| 69 | - $i++; |
|
| 70 | - } |
|
| 71 | - } |
|
| 72 | - ?> |
|
| 69 | + $i++; |
|
| 70 | + } |
|
| 71 | + } |
|
| 72 | + ?> |
|
| 73 | 73 | <?php } ?> |
| 74 | 74 | <?php wp_reset_postdata(); ?> |
| 75 | 75 | </div> |
@@ -17,15 +17,15 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | <div class="entry-content"> |
| 19 | 19 | <?php |
| 20 | - //the_content(); |
|
| 20 | + //the_content(); |
|
| 21 | 21 | |
| 22 | - wp_link_pages( array( |
|
| 23 | - 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
| 24 | - 'after' => '</div></div>', |
|
| 25 | - 'link_before' => '<span>', |
|
| 26 | - 'link_after' => '</span>', |
|
| 27 | - ) ); |
|
| 28 | - ?> |
|
| 22 | + wp_link_pages( array( |
|
| 23 | + 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
|
| 24 | + 'after' => '</div></div>', |
|
| 25 | + 'link_before' => '<span>', |
|
| 26 | + 'link_after' => '</span>', |
|
| 27 | + ) ); |
|
| 28 | + ?> |
|
| 29 | 29 | <div class="single-plan-inner recipes-content"> |
| 30 | 30 | <div class="single-plan-section-title recipes-plan title-lined"> |
| 31 | 31 | <?php lsx_get_svg_icon( 'recipes.svg' ); ?> |
@@ -34,30 +34,30 @@ discard block |
||
| 34 | 34 | <div class="recipes"> |
| 35 | 35 | <div class="row eating-row"> |
| 36 | 36 | <?php |
| 37 | - $connected_recipes = get_post_meta( get_the_ID(), 'connected_recipes', true ); |
|
| 38 | - if ( empty( $connected_recipes ) ) { |
|
| 39 | - $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
| 40 | - if ( isset( $options['connected_recipes'] ) && '' !== $options['connected_recipes'] && ! empty( $options['connected_recipes'] ) ) { |
|
| 41 | - $connected_recipes = $options['connected_recipes']; |
|
| 42 | - if ( ! array( $connected_recipes ) ) { |
|
| 43 | - $connected_recipes = array( $connected_recipes ); |
|
| 44 | - } |
|
| 45 | - } |
|
| 46 | - } |
|
| 47 | - $args = array( |
|
| 48 | - 'orderby' => 'date', |
|
| 49 | - 'order' => 'DESC', |
|
| 50 | - 'post_type' => 'recipe', |
|
| 51 | - 'post__in' => $connected_recipes, |
|
| 52 | - ); |
|
| 53 | - $recipes = new WP_Query( $args ); |
|
| 37 | + $connected_recipes = get_post_meta( get_the_ID(), 'connected_recipes', true ); |
|
| 38 | + if ( empty( $connected_recipes ) ) { |
|
| 39 | + $options = \lsx_health_plan\functions\get_option( 'all' ); |
|
| 40 | + if ( isset( $options['connected_recipes'] ) && '' !== $options['connected_recipes'] && ! empty( $options['connected_recipes'] ) ) { |
|
| 41 | + $connected_recipes = $options['connected_recipes']; |
|
| 42 | + if ( ! array( $connected_recipes ) ) { |
|
| 43 | + $connected_recipes = array( $connected_recipes ); |
|
| 44 | + } |
|
| 45 | + } |
|
| 46 | + } |
|
| 47 | + $args = array( |
|
| 48 | + 'orderby' => 'date', |
|
| 49 | + 'order' => 'DESC', |
|
| 50 | + 'post_type' => 'recipe', |
|
| 51 | + 'post__in' => $connected_recipes, |
|
| 52 | + ); |
|
| 53 | + $recipes = new WP_Query( $args ); |
|
| 54 | 54 | |
| 55 | - if ( $recipes->have_posts() ) { |
|
| 56 | - while ( $recipes->have_posts() ) { |
|
| 57 | - $recipes->the_post(); |
|
| 58 | - $post_id = get_the_id(); |
|
| 55 | + if ( $recipes->have_posts() ) { |
|
| 56 | + while ( $recipes->have_posts() ) { |
|
| 57 | + $recipes->the_post(); |
|
| 58 | + $post_id = get_the_id(); |
|
| 59 | 59 | |
| 60 | - ?> |
|
| 60 | + ?> |
|
| 61 | 61 | <div class="col-md-4 recipe-column"> |
| 62 | 62 | <div class="content-box box-shadow"> |
| 63 | 63 | <h3 class="recipe-title title-lined"><?php the_title(); ?></h3> |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | </div> |
| 67 | 67 | </div> |
| 68 | 68 | <?php |
| 69 | - } |
|
| 70 | - } |
|
| 71 | - ?> |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | + ?> |
|
| 72 | 72 | <?php wp_reset_postdata(); ?> |
| 73 | 73 | </div> |
| 74 | 74 | </div> |
@@ -23,11 +23,11 @@ |
||
| 23 | 23 | <?php if ( have_posts() ) : ?> |
| 24 | 24 | <?php |
| 25 | 25 | |
| 26 | - $count = 0; |
|
| 26 | + $count = 0; |
|
| 27 | 27 | |
| 28 | - while ( have_posts() ) : |
|
| 29 | - the_post(); |
|
| 30 | - ?> |
|
| 28 | + while ( have_posts() ) : |
|
| 29 | + the_post(); |
|
| 30 | + ?> |
|
| 31 | 31 | |
| 32 | 32 | <?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-plan.php'; ?> |
| 33 | 33 | |
@@ -41,36 +41,36 @@ discard block |
||
| 41 | 41 | <div class="post-sharing-wrapper"> |
| 42 | 42 | |
| 43 | 43 | <?php |
| 44 | - if ( class_exists( 'LSX_Sharing' ) ) { |
|
| 45 | - lsx_content_sharing(); |
|
| 46 | - } else { |
|
| 47 | - if ( function_exists( 'sharing_display' ) ) { |
|
| 48 | - sharing_display( '', true ); |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 52 | - $custom_likes = new Jetpack_Likes(); |
|
| 53 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 54 | - } |
|
| 55 | - } |
|
| 56 | - ?> |
|
| 44 | + if ( class_exists( 'LSX_Sharing' ) ) { |
|
| 45 | + lsx_content_sharing(); |
|
| 46 | + } else { |
|
| 47 | + if ( function_exists( 'sharing_display' ) ) { |
|
| 48 | + sharing_display( '', true ); |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 52 | + $custom_likes = new Jetpack_Likes(); |
|
| 53 | + echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 54 | + } |
|
| 55 | + } |
|
| 56 | + ?> |
|
| 57 | 57 | <?php endif ?> |
| 58 | 58 | </h2> |
| 59 | 59 | <?php echo wp_kses_post( lsx_hp_member_connected( $connected_members, 'recipe' ) ); ?> |
| 60 | 60 | <div class="row"> |
| 61 | 61 | <div class="col-md-6 recipe-image lsx-hp-shadow"> |
| 62 | 62 | <?php |
| 63 | - $featured_image = get_the_post_thumbnail(); |
|
| 64 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
| 65 | - the_post_thumbnail( 'large', array( |
|
| 66 | - 'class' => 'aligncenter', |
|
| 67 | - ) ); |
|
| 68 | - } else { |
|
| 69 | - ?> |
|
| 63 | + $featured_image = get_the_post_thumbnail(); |
|
| 64 | + if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
| 65 | + the_post_thumbnail( 'large', array( |
|
| 66 | + 'class' => 'aligncenter', |
|
| 67 | + ) ); |
|
| 68 | + } else { |
|
| 69 | + ?> |
|
| 70 | 70 | <img loading="lazy" src="<?php echo esc_attr( plugin_dir_url( __FILE__ ) . '../assets/images/placeholder.jpg' ); ?>"> |
| 71 | 71 | <?php |
| 72 | - } |
|
| 73 | - ?> |
|
| 72 | + } |
|
| 73 | + ?> |
|
| 74 | 74 | <?php if ( ( ! empty( $prep_time ) ) || ( ! empty( $cooking_time ) ) || ( ! empty( $serves ) ) || ( ! empty( $portion ) ) || ( ! empty( $energy ) ) || ( ! empty( $protein ) ) || ( ! empty( $carbohydrates ) ) || ( ! empty( $fibre ) ) || ( ! empty( $fat ) ) ) { ?> |
| 75 | 75 | <div class="recipe-data"> |
| 76 | 76 | <?php lsx_health_plan_recipe_data(); ?> |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | <?php echo do_shortcode( '[lsx_health_plan_featured_tips_block]' ); ?> |
| 83 | 83 | <div class="back-plan-btn"> |
| 84 | 84 | <?php |
| 85 | - if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 86 | - ?> |
|
| 85 | + if ( function_exists( 'wc_get_page_id' ) ) { |
|
| 86 | + ?> |
|
| 87 | 87 | <a class="btn" href="<?php echo wp_kses_post( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>"><?php esc_html_e( 'Back To My Plan', 'lsx-health-plan' ); ?></a> |
| 88 | 88 | <?php |
| 89 | - } |
|
| 90 | - ?> |
|
| 89 | + } |
|
| 90 | + ?> |
|
| 91 | 91 | </div> |
| 92 | 92 | </div> |
| 93 | 93 | </div> |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | <?php |
| 102 | 102 | if ( ! empty( $connected_articles ) ) { |
| 103 | - lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
|
| 103 | + lsx_hp_single_related( $connected_articles, __( 'Related articles', 'lsx-health-plan' ) ); |
|
| 104 | 104 | } |
| 105 | 105 | ?> |
| 106 | 106 | |