Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php while (have_posts()): the_post(); ?>
  4.  
  5. <?php
  6. $featured_image = get_post_thumbnail_id();
  7. $images = get_field('recipe_images');
  8. $video = (get_field('recipe_video') ? get_field('recipe_video') : false);
  9. $servings = get_field('servings');
  10. $default_servings_type_id = get_field('default_servings_type', 'option');
  11. $servings_type_id = get_field('servings_type');
  12. if (empty($servings_type_id)) {
  13. $servings_type_id = $default_servings_type_id;
  14. }
  15.  
  16. $servings_type = get_term_by('id', $servings_type_id, 'recipe_servings_type');
  17. $display_servings_icon = $servings_type_id == $default_servings_type_id;
  18. $preparation_time = get_field('preparation_time');
  19. $ingredients = get_field('ingredients');
  20. $ingredients_manual = get_field('ingredients_manual');
  21. $instructions = get_field('instructions');
  22. $tip_nina = get_field('tip_nina');
  23. $tip_elise = get_field('tip_elise');
  24. $recipe_description = get_field('recipe_description');
  25.  
  26. $cta_items_recipe = get_field('cta_default');
  27. $cta_items_general = get_field('cta_default', 'options');
  28. $cta_array = [];
  29.  
  30. if ($cta_items_general) {
  31. foreach ($cta_items_general as $key => $cta) {
  32. $cta_item = (empty($cta_items_recipe[$key]['cta'])) ? $cta['cta'] : $cta_items_recipe[$key]['cta'];
  33. array_push($cta_array, $cta_item);
  34. }
  35. }
  36.  
  37. $footer_content = [
  38. ["socials-bar"],
  39. ["cta", isset($cta_array[0]) ? $cta_array[0] : null],
  40. ["cta", isset($cta_array[1]) ? $cta_array[1] : null],
  41. ['banner', ['type' => 'single_recipe_between_ctas', 'class' => 'single-recipe-between-ctas-banner']],
  42. ["related-recipies"],
  43. ["cta", isset($cta_array[2]) ? $cta_array[2] : null],
  44. ["cta", isset($cta_array[3]) ? $cta_array[3] : null],
  45. ];
  46.  
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement