1 | <?php |
||
2 | /** |
||
3 | * LSX Recipes Shortcode. |
||
4 | * |
||
5 | * @package lsx-health-plan |
||
6 | */ |
||
7 | |||
8 | $args = array( |
||
9 | 'orderby' => 'date', |
||
10 | 'order' => 'DESC', |
||
11 | 'post_type' => 'recipe', |
||
12 | 'posts_per_page' => 3, |
||
13 | 'meta_key' => 'recipe_featured', |
||
14 | 'meta_compare' => 'EXISTS', |
||
15 | ); |
||
16 | $recipes = new WP_Query( $args ); |
||
17 | ?> |
||
18 | |||
19 | <div id="lsx-recipes-shortcode" class="daily-plan-block"> |
||
20 | <h2 class="title-lined"><?php esc_html_e( 'Featured Recipe', 'lsx-health-plan' ); ?></h2> |
||
21 | <div class="lsx-recipes-shortcode lsx-recipes-slider slick-slider slick-dotted slick-has-arrows" data-slick="{'slidesToShow': 1, 'slidesToScroll': 1}" > |
||
22 | |||
23 | <?php |
||
24 | if ( $recipes->have_posts() ) : |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
25 | while ( $recipes->have_posts() ) : |
||
0 ignored issues
–
show
|
|||
26 | $recipes->the_post(); |
||
27 | $post_id = get_the_id(); |
||
28 | $featured_image = get_the_post_thumbnail( $post_id, array( 600, 300 ) ); |
||
29 | ?> |
||
30 | <div class="lsx-recipes-slot"> |
||
31 | <div class="row"> |
||
32 | <div class="col-md-5 col-sm-6"> |
||
33 | <h4 class="lsx-recipes-title"><?php the_title(); ?></h4> |
||
34 | <?php lsx_health_plan_recipe_data(); ?> |
||
35 | <a href="<?php echo esc_url( get_permalink() ); ?>" class="btn"><?php esc_html_e( 'View Recipe', 'lsx-health-plan' ); ?></a> |
||
36 | </div> |
||
37 | <div class="col-md-7 col-sm-6"> |
||
38 | <?php |
||
39 | if ( ! empty( $featured_image ) ) { |
||
0 ignored issues
–
show
|
|||
40 | echo wp_kses_post( $featured_image ); |
||
41 | } |
||
42 | ?> |
||
43 | </div> |
||
44 | </div> |
||
45 | </div> |
||
46 | <?php endwhile; ?> |
||
0 ignored issues
–
show
|
|||
47 | <?php endif; ?> |
||
48 | <?php wp_reset_postdata(); ?> |
||
49 | </div> |
||
50 | </div> |
||
51 |