Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add Instagram Info to Recipe Card
<?php
//* Do NOT include the opening php tag
add_action( 'cookbook_recipe_after', 'cookbook_recipe_instagram', 10 );
/**
* Display the Instagram Information.
*/
function cookbook_recipe_instagram() {
echo '<div ' . cookbook_get_attr( $recipe, 'instagram' ) . '>';
echo '<i class="fa fa-instagram fa-5x fa-pull-left"></i>';
echo '<h4>Did you make a recipe?</h4>';
echo '<p>Tag <a href="http://instagram.com/cookbookplugin" target="_blank">@cookbookplugin</a> on Instagram and hashtag it <strong>#cookwithcookbook</strong>.</p>';
echo '</div>';
}
.cookbook-instagram {
background: #333;
color: #fff;
margin: -20px auto 0;
padding: 20px;
}
.cookbook-instagram h4 {
color: #fff;
margin: 3px 0 5px;
}
.cookbook-instagram a {
color: #fff;
text-decoration: underline;
}
.cookbook-instagram a:focus,
.cookbook-instagram a:hover {
color: #55585a;
}
.cookbook-instagram p {
margin-bottom: 0;
}
@media screen and (min-width: 500px) {
.cookbook-instagram {
margin: -20 auto 0;
padding: 30px;
}
}
@joshuadavidnelson

This comment has been minimized.

Copy link

joshuadavidnelson commented May 16, 2018

I was getting an error with the cookbook_recipe_instagram function, it looks like it's missing the $recipe parameter:

function cookbook_recipe_instagram( $recipe ) {
	echo '<div ' . cookbook_get_attr( $recipe, 'instagram' ) . '>';
		echo '<i class="fa fa-instagram fa-5x fa-pull-left"></i>';
		echo '<h4>Did you make a recipe?</h4>';
		echo '<p>Tag <a href="http://instagram.com/cookbookplugin" target="_blank">@cookbookplugin</a> on Instagram and hashtag it <strong>#cookwithcookbook</strong>.</p>';
	echo '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.