Advertisement
tcelestino

List post taxonomy

Jul 30th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. // categorias interaja
  2.     $labels = array(
  3.         'name' => _x( 'Categorias', 'interajas' ),
  4.         'singular_name' => _x( 'Categoria', 'interajas' ),
  5.         'search_items' =>  __( 'Buscar' ),
  6.         'all_items' => __( 'Todos' ),
  7.         'edit_item' => __( 'Editar' ),
  8.         'update_item' => __( 'Atualizar' ),
  9.         'add_new_item' => __( 'Adicionar uma nova categoria' ),
  10.         'new_item_name' => __( 'Nova Categoria' ),
  11.         'menu_name' => __( 'Categorias' ),
  12.       );
  13.     register_taxonomy('categoria-interaja','interaja', array(
  14.        'hierarchical' => true,
  15.        'labels' => $labels,
  16.        'show_ui' => true,
  17.        'query_var' => true,
  18.        'rewrite' => array( 'slug' => 'categoria-interaja' ),
  19.      ));
  20.  
  21.  
  22. // uso assim no taxonomy-categoria-interaja.php
  23.  
  24. <?php if(have_posts()) { $x = 0; while (have_posts()) { the_post(); $x++;
  25.  
  26.                 the_title(); } }
  27.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement