1. pertamax
Spoiler for pertamax:
2. buka header.php
Spoiler for header.php:
C. di tag div terserah agan dimana mau munculin slidernya, masukin ini
<div id="wordpresskus">
<ul class="bjqs">
<?php query_posts(array('post_type' => 'slider'));
while (have_posts()) : the_post(); ?>
<li>
<?php if(has_post_thumbnail()) :
the_post_thumbnail( 'large', array('title' => ''.get_the_title().'' ));
endif; ?>
<?php if($post->post_title) : ?>
<p class="bjqs-caption"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
<?php endif; ?>
</li>
<?php endwhile; wp_reset_query(); ?>
</ul>
</div>
add_theme_support( 'post-thumbnails' );
add_action( 'init', 'wordpresskus' );
function wordpresskus() {
register_post_type( 'slider',
array(
'labels' => array(
'name' => __( 'Slider' ),
'add_new_item' => __('Add New Slider'),
'edit_item' => __('Edit Slider'),
'view_item' => __('View Slider'),
'new_item' => __('New Slider'),
'singular_name' => __( 'Slider' )
),
'public' => true,
"capability_type" => "post",
'rewrite' => array('slug' => 'slider','with_front' => false),
"show_ui" => true,
'has_archive' => true,
'title' => get_the_title(),
'supports' => array("title", "thumbnail", "editor")
)
); }
4. di single.php dimana letak gambar dari slider ingin dimasukan masukin ini
Spoiler for single.php:
<?php if(has_post_thumbnail()) :
the_post_thumbnail( 'thumbnail', array('title' => ''.get_the_title().'' ));
endif ?>
masuk admin.
Slider -> add new
di column kanan paling bawah klik featured image, upload, Use as featured image.
untuk mengubah ukuran gambar di post Setting -> Media (ganti max width and max height di "Thumbnail size")
jika yg diatas sudah berhasiI, post dimari gan, melanjutkan bikin image nya ngelink ke halaman image tersebut