Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Buka post-single.php:
- 1. Cari kode thumbnail:
- <?php
- if(has_post_thumbnail()) {
- the_post_thumbnail(
- array($theme->get_option('featured_image_width_single'), $theme->get_option('featured_image_height_single')),
- array("class" => $theme->get_option('featured_image_position_single') . " featured_image")
- );
- }
- ?>
- 2. Ganti dengan kode berikut:
- <div class="wp-caption">
- <?php the_post_thumbnail(''); ?> <!-- This displays the featured image -->
- <?php if ( $caption = get_post( get_post_thumbnail_id() )->post_excerpt ) : ?>
- <p class="wp-caption-text"><?php echo $caption; ?></p>
- <?php endif; ?><!-- This displays the caption below the featured image -->
- </div>
- 3. Tambahkan kode berikut di CSS:
- .wp-caption {
- background: #eee;
- border: 1px solid #ddd;
- text-align: center;
- padding: 4px 4px 0 4px;
- margin: 10px;
- /* optional rounded corners for browsers that support it */
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- }
- .wp-caption img {
- margin: 0;
- padding: 0;
- border: 0 none;
- }
- .wp-caption p.wp-caption-text {
- font-size: 11px;
- line-height: 17px;
- padding: 0 4px 5px;
- margin: 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement