Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php while (have_posts()): the_post(); ?>
- <?php
- $featured_image = get_post_thumbnail_id();
- $images = get_field('recipe_images');
- $video = (get_field('recipe_video') ? get_field('recipe_video') : false);
- $servings = get_field('servings');
- $default_servings_type_id = get_field('default_servings_type', 'option');
- $servings_type_id = get_field('servings_type');
- if (empty($servings_type_id)) {
- $servings_type_id = $default_servings_type_id;
- }
- $servings_type = get_term_by('id', $servings_type_id, 'recipe_servings_type');
- $display_servings_icon = $servings_type_id == $default_servings_type_id;
- $preparation_time = get_field('preparation_time');
- $ingredients = get_field('ingredients');
- $ingredients_manual = get_field('ingredients_manual');
- $instructions = get_field('instructions');
- $tip_nina = get_field('tip_nina');
- $tip_elise = get_field('tip_elise');
- $recipe_description = get_field('recipe_description');
- $cta_items_recipe = get_field('cta_default');
- $cta_items_general = get_field('cta_default', 'options');
- $cta_array = [];
- if ($cta_items_general) {
- foreach ($cta_items_general as $key => $cta) {
- $cta_item = (empty($cta_items_recipe[$key]['cta'])) ? $cta['cta'] : $cta_items_recipe[$key]['cta'];
- array_push($cta_array, $cta_item);
- }
- }
- $footer_content = [
- ["socials-bar"],
- ["cta", isset($cta_array[0]) ? $cta_array[0] : null],
- ["cta", isset($cta_array[1]) ? $cta_array[1] : null],
- ['banner', ['type' => 'single_recipe_between_ctas', 'class' => 'single-recipe-between-ctas-banner']],
- ["related-recipies"],
- ["cta", isset($cta_array[2]) ? $cta_array[2] : null],
- ["cta", isset($cta_array[3]) ? $cta_array[3] : null],
- ];
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement