Advertisement
Guest User

Untitled

a guest
Jul 9th, 2011
2,083
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. register_post_type('news', array( 'label' => 'News','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'news'),'query_var' => true,'has_archive' => true,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),'labels' => array (
  2. 'name' => 'News',
  3. 'singular_name' => 'News',
  4. 'menu_name' => 'News',
  5. 'add_new' => 'Add News',
  6. 'add_new_item' => 'Add New News',
  7. 'edit' => 'Edit',
  8. 'edit_item' => 'Edit News',
  9. 'new_item' => 'New News',
  10. 'view' => 'View News',
  11. 'view_item' => 'View News',
  12. 'search_items' => 'Search News',
  13. 'not_found' => 'No News Found',
  14. 'not_found_in_trash' => 'No News Found in Trash',
  15. 'parent' => 'Parent News',
  16. ),) );
  17.  
  18.  
  19. define('PER_PAGE_DEFAULT', 2);
  20. function news_query_posts(array $query = array())
  21. {
  22. global $wp_query;
  23. wp_reset_query();
  24.  
  25. $paged = get_query_var('paged') ? get_query_var('paged') : 1;
  26.  
  27. $defaults = array(
  28. 'paged' => $paged,
  29. 'post_type' => 'news',
  30. 'posts_per_page' => PER_PAGE_DEFAULT
  31. );
  32. $query += $defaults;
  33.  
  34. $wp_query = new WP_Query($query);
  35. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement