@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | $tab_experience['content'] = get_post_meta( get_the_ID(), 'team_member_experience', true ); |
| 8 | 8 | $tab_experience['shortcode'] = ''; |
| 9 | 9 | if ( ! empty( $tab_experience['content'] ) ) { |
| 10 | - $tabs[] = $tab_experience; |
|
| 10 | + $tabs[] = $tab_experience; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | // Tab Featured plan |
@@ -18,76 +18,76 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | if ( ! empty( $tab_plans['posts'] ) ) { |
| 20 | 20 | |
| 21 | - $plan_content = ''; |
|
| 21 | + $plan_content = ''; |
|
| 22 | 22 | |
| 23 | - $include = implode( ',', $tab_plans['posts'] ); |
|
| 24 | - $args = array( |
|
| 25 | - 'orderby' => 'menu_order', |
|
| 26 | - 'order' => 'ASC', |
|
| 27 | - 'post_type' => 'plan', |
|
| 28 | - 'post__in' => $tab_plans['posts'], |
|
| 29 | - ); |
|
| 30 | - //$the_query = new WP_Query( $args ); |
|
| 23 | + $include = implode( ',', $tab_plans['posts'] ); |
|
| 24 | + $args = array( |
|
| 25 | + 'orderby' => 'menu_order', |
|
| 26 | + 'order' => 'ASC', |
|
| 27 | + 'post_type' => 'plan', |
|
| 28 | + 'post__in' => $tab_plans['posts'], |
|
| 29 | + ); |
|
| 30 | + //$the_query = new WP_Query( $args ); |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"> |
|
| 33 | + $plan_content = '<div class="all-plans-block plan-grid block-all-plans-block team-member-plans"> |
|
| 34 | 34 | <div class="row">'; |
| 35 | 35 | |
| 36 | - foreach( $tab_plans['posts'] as $index => $post ) { |
|
| 37 | - |
|
| 38 | - $plan_content .= '<div class="col-xs-12 col-sm-6 col-md-4">'; |
|
| 39 | - $plan_content .= '<article class="lsx-slot lsx-hp-shadow">'; |
|
| 40 | - $plan_content .= '<div class="plan-feature-img">'; |
|
| 41 | - $plan_content .= '<a href="' . get_permalink( $post ) . '">'; |
|
| 42 | - |
|
| 43 | - $linked_product = false; |
|
| 44 | - $restricted = false; |
|
| 45 | - $product = null; |
|
| 46 | - if ( \lsx_health_plan\functions\woocommerce\plan_has_products($post) ) { |
|
| 47 | - $products = \lsx_health_plan\functions\woocommerce\get_plan_products($post); |
|
| 48 | - $linked_product = wc_get_product( $products[0] ); |
|
| 49 | - $product = $linked_product; |
|
| 50 | - } |
|
| 51 | - if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) { |
|
| 52 | - $restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() ); |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - $featured_image = get_the_post_thumbnail( $post ); |
|
| 56 | - if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
| 57 | - $plan_content .= $featured_image; |
|
| 58 | - } else { |
|
| 59 | - $plan_content .= '<img loading="lazy" class="placeholder" src="' . plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' . '">'; |
|
| 60 | - } |
|
| 61 | - $plan_content .= '</a>'; |
|
| 62 | - $plan_content .= '</div>'; |
|
| 63 | - |
|
| 64 | - $plan_content .= '<div class="content-box plan-content-box">'; |
|
| 65 | - $plan_content .= '<h3 class="plan"><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . '</a></h3>'; |
|
| 66 | - |
|
| 67 | - if ( false !== $linked_product && false !== $restricted ) { |
|
| 68 | - $plan_content .= $linked_product->get_price_html(); |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - $plan_content .= '<div class="excerpt">'; |
|
| 72 | - if ( ! has_excerpt( $post ) ) { |
|
| 73 | - $content = wp_trim_words( get_the_content( $post ), 20 ); |
|
| 74 | - $plan_content .= '<p>' . $content . '</p>'; |
|
| 75 | - } else { |
|
| 76 | - $plan_content .= apply_filters( 'the_excerpt', get_the_excerpt( $post ) ); |
|
| 77 | - } |
|
| 78 | - $plan_content .= '</div>'; |
|
| 79 | - |
|
| 80 | - $plan_content .= '</div>'; |
|
| 81 | - $plan_content .= '</article>'; |
|
| 82 | - $plan_content .= '</div>'; |
|
| 83 | - |
|
| 84 | - } |
|
| 85 | - $plan_content .= '</div></div>'; |
|
| 36 | + foreach( $tab_plans['posts'] as $index => $post ) { |
|
| 37 | + |
|
| 38 | + $plan_content .= '<div class="col-xs-12 col-sm-6 col-md-4">'; |
|
| 39 | + $plan_content .= '<article class="lsx-slot lsx-hp-shadow">'; |
|
| 40 | + $plan_content .= '<div class="plan-feature-img">'; |
|
| 41 | + $plan_content .= '<a href="' . get_permalink( $post ) . '">'; |
|
| 42 | + |
|
| 43 | + $linked_product = false; |
|
| 44 | + $restricted = false; |
|
| 45 | + $product = null; |
|
| 46 | + if ( \lsx_health_plan\functions\woocommerce\plan_has_products($post) ) { |
|
| 47 | + $products = \lsx_health_plan\functions\woocommerce\get_plan_products($post); |
|
| 48 | + $linked_product = wc_get_product( $products[0] ); |
|
| 49 | + $product = $linked_product; |
|
| 50 | + } |
|
| 51 | + if ( function_exists( 'wc_memberships_is_post_content_restricted' ) ) { |
|
| 52 | + $restricted = wc_memberships_is_post_content_restricted( get_the_ID() ) && ! current_user_can( 'wc_memberships_view_restricted_post_content', get_the_ID() ); |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + $featured_image = get_the_post_thumbnail( $post ); |
|
| 56 | + if ( ! empty( $featured_image ) && '' !== $featured_image ) { |
|
| 57 | + $plan_content .= $featured_image; |
|
| 58 | + } else { |
|
| 59 | + $plan_content .= '<img loading="lazy" class="placeholder" src="' . plugin_dir_url( __DIR__ ) . '../assets/images/placeholder.jpg' . '">'; |
|
| 60 | + } |
|
| 61 | + $plan_content .= '</a>'; |
|
| 62 | + $plan_content .= '</div>'; |
|
| 63 | + |
|
| 64 | + $plan_content .= '<div class="content-box plan-content-box">'; |
|
| 65 | + $plan_content .= '<h3 class="plan"><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . '</a></h3>'; |
|
| 66 | + |
|
| 67 | + if ( false !== $linked_product && false !== $restricted ) { |
|
| 68 | + $plan_content .= $linked_product->get_price_html(); |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + $plan_content .= '<div class="excerpt">'; |
|
| 72 | + if ( ! has_excerpt( $post ) ) { |
|
| 73 | + $content = wp_trim_words( get_the_content( $post ), 20 ); |
|
| 74 | + $plan_content .= '<p>' . $content . '</p>'; |
|
| 75 | + } else { |
|
| 76 | + $plan_content .= apply_filters( 'the_excerpt', get_the_excerpt( $post ) ); |
|
| 77 | + } |
|
| 78 | + $plan_content .= '</div>'; |
|
| 79 | + |
|
| 80 | + $plan_content .= '</div>'; |
|
| 81 | + $plan_content .= '</article>'; |
|
| 82 | + $plan_content .= '</div>'; |
|
| 83 | + |
|
| 84 | + } |
|
| 85 | + $plan_content .= '</div></div>'; |
|
| 86 | 86 | |
| 87 | - $tab_plans['content'] = $plan_content; |
|
| 87 | + $tab_plans['content'] = $plan_content; |
|
| 88 | 88 | } |
| 89 | 89 | if ( ! empty( $tab_plans['content'] ) ) { |
| 90 | - $tabs[] = $tab_plans; |
|
| 90 | + $tabs[] = $tab_plans; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
@@ -98,15 +98,15 @@ discard block |
||
| 98 | 98 | $tab_testimonial['content'] = ''; |
| 99 | 99 | |
| 100 | 100 | if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['posts'] ) ) ) { |
| 101 | - if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
| 102 | - $columns = count( $tab_testimonial['posts'] ); |
|
| 103 | - } else { |
|
| 104 | - $columns = 3; |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
| 108 | - $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
|
| 109 | - $tabs[] = $tab_testimonial; |
|
| 101 | + if ( count( $tab_testimonial['posts'] ) <= 2 ) { |
|
| 102 | + $columns = count( $tab_testimonial['posts'] ); |
|
| 103 | + } else { |
|
| 104 | + $columns = 3; |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + $post_ids = join( ',', $tab_testimonial['posts'] ); |
|
| 108 | + $tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]'; |
|
| 109 | + $tabs[] = $tab_testimonial; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | if ( count( $tabs ) > 0 ) : ?> |