Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action('init', 'type_post_representantes');
- function type_post_representantes() {
- $labels = array(
- 'name' => _x('Representantes', 'post type general name'),
- 'singular_name' => _x('Representantes', 'post type singular name'),
- 'add_new' => _x('Adicionar Novo', 'Novo item'),
- 'add_new_item' => __('Novo Item'),
- 'edit_item' => __(' Item'),
- 'new_item' => __('Novo Item'),
- 'view_item' => __('Ver Item'),
- 'search_items' => __('Procurar Itens'),
- 'not_found' => __('Nenhum registro encontrado'),
- 'not_found_in_trash' => __('Nenhum registro encontrado na lixeira'),
- 'parent_item_colon' => '',
- 'menu_name' => 'Representantes'
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'public_queryable' => true,
- 'show_ui' => true,
- 'query_var' => true,
- 'rewrite' => true,
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array('title','editor','thumbnail','comments', 'excerpt', 'custom-fields', 'revisions', 'trackbacks')
- );
- register_post_type( 'representantes' , $args );
- flush_rewrite_rules();
- }
- ?>
- <?php
- register_taxonomy(
- "categorias",
- "representantes",
- array(
- "label" => "Categorias",
- "singular_label" => "Categoria",
- "rewrite" => true,
- "hierarchical" => true
- )
- );
- ?>
- html:
- <?php
- $newsArgs = array( 'post_type' => 'representantes', 'posts_per_page' => 30);
- $newsLoop = new WP_Query( $newsArgs );
- while ( $newsLoop->have_posts() ) : $newsLoop->the_post(); ?>
- <div class="representantes" style="display:block !important;"><!---blocos--->
- <?php the_taxonomies(array('template' => '% %l')); ?>
- <?php the_content(); ?>
- </div><!--FINAL BLOCO-->
- <?php endwhile; ?>
- <?php the_taxonomies(array('template' => '% %l')); ?>
Add Comment
Please, Sign In to add comment