Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Register Custom Post Types********************************************/
- add_action( 'init', 'create_post_type' );
- function create_post_type() {
- register_post_type( 'testimonial',
- array(
- 'labels' => array(
- 'name' => __( 'Testimonial' ),
- 'singular_name' => __( 'Testimonial' ),
- 'add_new' => __( 'Add New' ),
- 'add_new_item' => __( 'Add New Testimonial' ),
- 'edit_item' => __( 'Edit Testimonial' ),
- 'new_item' => __( 'New Testimonial' ),
- 'view_item' => __( 'View Testimonial' ),
- 'not_found' => __( 'Sorry, we couldn\'t find the Testimonial you are looking for.' )
- ),
- 'public' => true,
- 'publicly_queryable' => false,
- 'exclude_from_search' => true,
- 'menu_position' => 14,
- 'has_archive' => false,
- 'hierarchical' => false,
- 'capability_type' => 'page',
- 'rewrite' => array( 'slug' => 'testimonial' ),
- 'supports' => array( 'title', 'editor', 'custom-fields' )
- )
- );
- }
- Query Post from a specific category
- <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?>
- Register Custom Post
- Pastebin Code Link: http://pastebin.com/Fkgnu2KL
- Query Custom Post List
- <?php query_posts('post_type=testimonial&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?>
- Query Custom Post Single
- copy your single.php file & rename single-<custom-post>.php
- <custom-post> = Custom Post Type
- টিউটোরিয়াল লিংক: http://rrfoundation.net/365
- সোর্স থিম ডাউনলোড: http://sdrv.ms/T4THqZ
- পর্ব দুই এর
- টিউটোরিয়াল লিংক: http://rrfoundation.net/369
- সোর্স থিম ডাউনলোড: http://sdrv.ms/T4THqZ
- LikeLike ·
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement