Filter: Force pinning of recipe card image

If you're interested in forcing the pinning of the recipe card image, you can use this filter to add it in! Just add in the following snippet to your theme's functions.php file:

***Before doing this, make sure that you have access to your site's files via FTP (the editor in WordPress is not sufficient in case problems arise) and that you are comfortable with editing your functions.php file. Any minor error in the functions.php file can result in the “white screen of death,” which is easily fixed via FTP but is difficult to fix otherwise (and a nuisance as your site will be unavailable until fixed).***

* Enable forced pinning of the recipe card image.

add_filter( 'tasty_recipes_force_pin_image_url', function( $_, $recipe ) { $recipe_json = $recipe->to_json(); return ! empty( $recipe_json['image_sizes']['large'] ) ? $recipe_json['image_sizes']['large']['url'] : ''; }, 10, 2 );

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support