Add Instagram Info to Recipe Card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was getting an error with the
cookbook_recipe_instagram
function, it looks like it's missing the$recipe
parameter: