Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custome_post_reg(){
- register_post_type('slider', array(
- 'public' => true,
- 'label' => 'slide',
- 'labels' => array(
- 'name' => 'slides',
- 'singular_name' => 'slide',
- 'add_new' => 'add new slide',
- ),
- 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),
- ));
- }
- add_action('init', 'custome_post_reg');
- //Custom Post Query index.php geya kiraty hoba.
- <?php query_posts( array(
- 'post_type' => 'slide',
- 'posts_per_page' => 3,
- ) ); ?>
- <?php while ( have_posts() ) : the_post();?>
- <li>
- <?php the_post_thumbnail('slide_image'); ?>
- <div class="flex-caption">
- <h3><?php the_title(); ?></h3>
- <?php the_excerpt(); ?>
- <a href="#" class="btn btn-theme">Learn More</a>
- </div>
- </li>
- <?php endwhile; ?>
- <?php wp_reset_query();?>
Add Comment
Please, Sign In to add comment