get_description(); ?>
get_field(
esc_html__( 'Type', 'rank-math-pro' ),
'recipeCategory'
);
?>
get_field(
esc_html__( 'Cuisine', 'rank-math-pro' ),
'recipeCuisine'
);
?>
get_field(
esc_html__( 'Keywords', 'rank-math-pro' ),
'keywords'
);
?>
get_field(
esc_html__( 'Recipe Yield', 'rank-math-pro' ),
'recipeYield'
);
?>
get_field(
esc_html__( 'Calories', 'rank-math-pro' ),
'nutrition.calories'
);
?>
get_field(
esc_html__( 'Preparation Time', 'rank-math-pro' ),
'prepTime'
);
?>
get_field(
esc_html__( 'Cooking Time', 'rank-math-pro' ),
'cookTime'
);
?>
get_field(
esc_html__( 'Total Time', 'rank-math-pro' ),
'totalTime'
);
?>
get_field(
esc_html__( 'Recipe Video Name', 'rank-math-pro' ),
'video.name'
);
?>
get_field(
esc_html__( 'Recipe Video Description', 'rank-math-pro' ),
'video.description'
);
?>
get_field(
esc_html__( 'Recipe Video Thumbnail', 'rank-math-pro' ),
'video.thumbnailUrl'
);
?>
get_field_value( 'video' );
if ( ! empty( $videoembed ) ) {
global $wp_embed;
if ( ! empty( $videoembed['embedUrl'] ) ) {
echo do_shortcode( $wp_embed->autoembed( $videoembed['embedUrl'] ) );
} elseif ( ! empty( $videoembed['contentUrl'] ) ) {
echo do_shortcode( $wp_embed->autoembed( $videoembed['contentUrl'] ) );
}
}
?>
get_field_value( 'recipeIngredient' );
$shortcode->output_field(
esc_html__( 'Recipe Ingredients', 'rank-math-pro' ),
'
- ' . join( '
- ', $ingredient ) . '
'
);
?>
get_field_value( 'recipeInstructions' );
if ( is_string( $instructions ) ) {
$shortcode->get_field(
esc_html__( 'Recipe Instructions', 'rank-math-pro' ),
'recipeInstructions'
);
} else {
// HowTo Array.
if ( isset( $instructions[0]['@type'] ) && 'HowtoStep' === $instructions[0]['@type'] ) {
$instructions = wp_list_pluck( $instructions, 'text' );
$shortcode->output_field(
esc_html__( 'Recipe Instructions', 'rank-math-pro' ),
'
- ' . join( '
- ', $instructions ) . '
'
);
}
// Single HowToSection data.
if ( ! empty( $instructions['itemListElement'] ) ) {
$shortcode->output_field(
esc_html__( 'Recipe Instructions', 'rank-math-pro' ),
''
);
$shortcode->output_field(
$instructions['name'],
'
- ' . join( '
- ', wp_list_pluck( $instructions['itemListElement'], 'text' ) ) . '
'
);
}
// Multiple HowToSection data.
if ( isset( $instructions[0]['@type'] ) && 'HowToSection' === $instructions[0]['@type'] ) {
$shortcode->output_field(
esc_html__( 'Recipe Instructions', 'rank-math-pro' ),
''
);
foreach ( $instructions as $section ) {
if ( empty( $section['itemListElement'] ) ) {
continue;
}
$data = '';
foreach ( $section['itemListElement'] as $item ) {
$url = ! empty( $item['url'] ) ? $item['url'] : '';
$name = ! empty( $item['name'] ) ? $item['name'] : '';
$image = ! empty( $item['image'] ) ? $item['image']['url'] : '';
$text = ! empty( $item['text'] ) ? $item['text'] : '';
$data .= '
';
$data .= '
';
$data .= '
';
$data .= '
' . esc_html( $text ) . '
';
$data .= '
';
$data .= '
';
$data .= '
';
}
echo '
';
$shortcode->output_field(
$section['name'],
$data
);
echo '
';
}
}
}
?>
show_ratings(); ?>