Advertisement
sparkweb

Show Author Meta on Product

Sep 4th, 2011
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.67 KB | None | 0 0
  1. //Customized Author Headings
  2. $author_meta = "";
  3. if (get_post_meta($product['id'],'_author',TRUE)) $author_meta .= 'By ' . htmlspecialchars(get_post_meta($product['id'],'_author',TRUE)) . "<br />\n";
  4. if (get_post_meta($product['id'],'_illustrator',TRUE)) $author_meta .= 'Illustrations By ' . htmlspecialchars(get_post_meta($product['id'],'_illustrator',TRUE)) . "<br />\n";
  5. if (get_post_meta($product['id'],'_translator',TRUE)) $author_meta .= 'Translated By ' . htmlspecialchars(get_post_meta($product['id'],'_translator',TRUE)) . "<br />\n";
  6. if (get_post_meta($product['id'],'_isbn',TRUE)) $author_meta .= 'ISBN: ' . htmlspecialchars(get_post_meta($product['id'],'_isbn',TRUE)) . "<br />\n";
  7. if (get_post_meta($product['id'],'_ebook_link',TRUE)) $author_meta .= '<a href="' . htmlspecialchars(get_post_meta($product['id'],'_ebook_link',TRUE)) . '" target=_blank" class="ebook-link">Download E-Book</a>' . "<br />\n";
  8. if (get_post_meta($product['id'],'_kindle_link',TRUE)) $author_meta .= '<a href="' . htmlspecialchars(get_post_meta($product['id'],'_kindle_link',TRUE)) . '" target=_blank" class="kindle-link">Click here to buy in Kindle format</a>' . "<br />\n";
  9. if (get_post_meta($product['id'],'_ibooks_link',TRUE)) $author_meta .= '<a href="' . htmlspecialchars(get_post_meta($product['id'],'_ibooks_link',TRUE)) . '" target=_blank" class="ibooks-link">Click here to buy in iBooks format</a>' . "<br />\n";
  10. if (get_post_meta($product['id'],'_nook_link',TRUE)) $author_meta .= '<a href="' . htmlspecialchars(get_post_meta($product['id'],'_nook_link',TRUE)) . '" target=_blank" class="nook-link">Click here to buy in Nook format</a>' . "<br />\n";
  11. if ($author_meta) echo "<p>$author_meta</p>\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement