Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,17 @@ function display_rich_snippet($content) {
{
if($args_recipe['recipe_name'] != "")
$recipe .= '<div class="snippet-label-img">'.esc_attr( stripslashes( $args_recipe['recipe_name'] ) ).'</div>';


$recipe .= '<div class="snippet-data-img"><span itemprop="name">'.esc_attr( $recipes_name ).'</span></div>
<meta itemprop="description" content="'.esc_attr( htmlspecialchars_decode( $recipes_desc ) ).'" >
<meta itemprop="recipeIngredient" content="'.esc_attr( $recipes_ingredient ).'" >
<div itemprop="nutrition"
<meta itemprop="description" content="'.esc_attr( htmlspecialchars_decode( $recipes_desc ) ).'" >';

$arr_recipes_ingredient = explode(',',$recipes_ingredient);
foreach ($arr_recipes_ingredient as $ingredient) {
$recipe .= '<meta itemprop="recipeIngredient" content="'.$ingredient.'" >';
}

$recipe .= '<div itemprop="nutrition"
itemscope itemtype="http://schema.org/NutritionInformation">
<meta itemprop="calories" content="'.esc_attr( $recipes_nutrition ).'" ></div>
<div class="snippet-clear"></div>';
Expand Down
2 changes: 1 addition & 1 deletion meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function bsf_metaboxes( array $meta_boxes ) {
),
array(
'name' => __('Ingredients','rich-snippets'),
'desc' => __('Enter the ingredients used','rich-snippets'),
'desc' => __('Enter ingredients used separated by commas (ingredient 1, ingredient 2, etc)','rich-snippets'),
'id' => $prefix . 'recipes_ingredient',
'class' => 'recipes',
'type' => 'text_medium',
Expand Down