Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://wpsnipp.com/index.php/functions-php/embed-google-books-in-your-posts-using-shortcode/
- How to Embed Google books in your posts using shortcode
- Copy in function.php:
- add_shortcode('gbooks', 'sc_embed_google_books');
- function sc_embed_google_books( $atts ){
- extract(shortcode_atts(array(
- "id" => '',
- "width" => '600',
- "height" => '900',
- ), $atts));
- return '<script type="text/javascript" src="http://books.google.com/books/previewlib.js"></script>
- <script type="text/javascript">
- GBS_insertEmbeddedViewer("'.$id.'", '.$width.','.$height.');
- </script>';
- }
- Post:
- [gbooks id="0578022702" width="400" height="400"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement