Advertisement
pusatdata

WP-Plugin: Gambar Plugin Novelist pada Theme

Oct 8th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. ambil dari kode image novelist pada file berikut:
  2. wp-content/plugins/novelist/templates/shortcode-book-content-image.php
  3.  
  4.  
  5.  
  6. copy paste kode tersebut pada post.php di theme:
  7.  
  8. <?php
  9. /**
  10. * Displays the book cover image.
  11. *
  12. * @package novelist
  13. * @copyright Copyright (c) 2016, Nose Graze Ltd.
  14. * @license GPL2+
  15. */
  16. $cover_id = get_post_meta( get_the_ID(), 'novelist_cover', true );
  17. // If there's no image uploaded, try the default.
  18. if ( empty( $cover_id ) || ! is_numeric( $cover_id ) ) {
  19. $cover_id = novelist_get_option( 'default_cover_image', false );
  20. if ( empty( $cover_id ) ) {
  21. return;
  22. }
  23. }
  24. $cover_size = apply_filters( 'novelist/shortcode/book/cover-image-size', array( 315, 375 ) );
  25. ?>
  26. <div class="novelist-book-cover-image">
  27. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
  28. <?php echo wp_get_attachment_image( $cover_id, $cover_size ); ?>
  29. </a>
  30. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement