Plugin Author
Brecht
(@brechtvds)
Hi there,
Try adding the following code to your theme’s functions.php file (but make sure to change wpurp_servings to whatever metakey you’re using on your website):
function wpurp_output_recipe( $template, $recipe )
{
$servings = get_user_meta( get_current_user_id(), ‘wpurp_servings’, true);
if( $servings ) {
$template .= ‘<script>jQuery(document).ready(function() { jQuery(“.wpurp-recipe-servings-changer input”).val(‘ . $servings . ‘).change(); });</script>’;
}
return $template;
}
add_filter( ‘wpurp_output_recipe’, ‘wpurp_output_recipe’, 10, 2 );
Thanks! It worked! I had to add the change function to the footer using wp_footer action; otherwise change() was not triggering the change function!
function namespace_adjust_servings() {
echo ‘<script>jQuery(document).ready(function() {if( jQuery(“.wpurp-recipe-servings-changer input.adjust-recipe-servings”).length ){jQuery(“.wpurp-recipe-servings-changer input.adjust-recipe-servings”).change();}});</script>’;
}
add_action(‘wp_footer’, ‘namespace_adjust_servings’, 100);
I know this gets checked on all pages but could not figure out how to put the script after the adjustable_servings.js has been added to the document. Let me know if you have a better workaround!
Thanks a bunch! Appreciate the prompt response 🙂
hi, i have installed wp recipe plugin.i want to remove the text “powered by wp ulitimate recipe”.thanks for any help
Plugin Author
Brecht
(@brechtvds)
Hi there,
You can disable that link on the Recipes > Settings > Recipe Template > Recipe Box page.
Kind regards,
Brecht