Codesnipp.it Social Code Sharing

kraudio

functions.php

by kraudio on Feb 02, 2012

<?php if ( ! isset( $content_width ) ) $content_width = 620; /*===INCLUDES DE ARQUIVOS REQUERIDOS===*/ require_once(TEMPLATEPATH . '/admin/core-function.php'); require_once(TEMPLATEPATH . '/includes/wo-widgets.php'); require_once(TEMPLATEPATH . '/admin/options-tema.php'); require_once(TEMPLATEPATH . '/includes/ie.php'); require_once(TEMPLATEPATH . '/includes/meta-box.php'); /*===INCLUDES WO-PLUGINS===*/ require(TEMPLATEPATH . '/plugins/galeria.php'); if(get_option('wo_plugin_login') != 'not'){ require_once(TEMPLATEPATH . '/plugins/login/login.php'); } if(get_option('wo_plugin_shortcodes') != 'not'){ require_once(TEMPLATEPATH . '/shortcodes/shortcodes.php'); } if(get_option('wo_plugin_extra_editor') != 'not'){ require_once(TEMPLATEPATH . '/plugins/extra_editor.php'); } if(get_option('wo_plugin_fancybox') != 'not'){ require_once(TEMPLATEPATH . '/plugins/fancybox/fancybox.php'); } if(get_option('wo_plugin_admin_extra_info') != 'not'){ require_once(TEMPLATEPATH . '/plugins/admin-infos.php'); } //Registra e chama os scripts jQuery do tema if ( ! function_exists( 'init_jquery_scripts' ) ): function init_jquery_scripts() { // Registrando scripts wp_register_script('search', get_template_directory_uri() . '/js/search.js', array('jquery'), '1.0'); wp_register_script('easing', get_template_directory_uri() . '/js/easing.js', array('jquery'), '1.3'); wp_register_script('superfish', get_template_directory_uri() . '/js/superfish.js', array('jquery', 'easing'), '1.4.8'); wp_register_script('cycle', get_template_directory_uri() . '/js/jquery.cycle.js', array('jquery', 'easing'), '2.88'); wp_register_script('jcarousellite', get_template_directory_uri() . '/js/jcarousellite.js', array('jquery', 'easing'), '2.88'); wp_register_script('slide_vertical', get_template_directory_uri() . '/js/jcarousellite_custom_vertical.js', array('jquery', 'easing'), '1'); wp_register_script('slide_horizontal', get_template_directory_uri() . '/js/jcarousellite_custom_horizontal.js', array('jquery', 'easing'), '1'); wp_register_script('contato_js', get_template_directory_uri() . '/js/valida_page_contato.js', array('jquery'), '1'); wp_register_script('comment', get_template_directory_uri() . '/js/comment.js', array( 'jquery', 'easing' ), '1.0'); wp_register_script('page_templates', get_template_directory_uri() . '/admin/js/options-templates-page.js', array('jquery'), '1'); //Carrega script dentro do painel admin if ( is_admin() ) { $pagina_atual = get_current_screen(); if( $pagina_atual->id == 'page' ) { wp_enqueue_script( 'page_templates' ); } } // Chamando scripts fora do painel admin if(!is_admin()){ global $wpdb; $post_slide = $wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post_slide'"); if( $post_slide > 0 && is_home()) { wp_enqueue_script( 'cycle' ); } wp_enqueue_script( 'search' ); // Dependência - Scripts chamados somente em casos específicos. if(has_nav_menu( 'menu_superior_secundario' ) != ''){ wp_enqueue_script( 'superfish' ); } if(is_page_template('template-contact.php')){ wp_enqueue_script( 'contato_js' ); } if(is_home() || is_front_page()) { $option_slide = get_option('zinm3_mini_posts_slide'); if($option_slide != '') { wp_enqueue_script( 'jcarousellite' ); wp_enqueue_script( trim($option_slide) ); } } if ( is_singular() && get_option( 'thread_comments' ) ){ wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'comment' ); } } } add_action( 'wp_print_scripts' , 'init_jquery_scripts' ); endif; //Recursos nativos que este tema deve suportar if ( ! function_exists( 'wo_theme_support' ) ): function wo_theme_support(){ add_theme_support( 'automatic-feed-links' ); add_custom_background(); } add_action( 'after_setup_theme', 'wo_theme_support' ); endif; //Redirecionamento para a página de configuração ao ativar o tema e seta alguns valores padrões if ( is_admin() && isset($_GET['activated'] ) && $pagenow == 'themes.php' ) { otera_options_tema_default_value(); $user = wp_get_current_user(); update_user_option($user->ID, 'managenav-menuscolumnshidden', array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', ), true); wp_redirect('admin.php?page=options-tema.php'); } //Logo do site usando imagem PNG function logo_site_img(){ $logo = get_option( 'zinm3_site_logo' ); if( $logo == true ) { ?> <style type="text/css" media="all">#logo h1 a{ background:url(<?php echo trim($logo); ?>) no-repeat left top;}</style> <?php } } add_action('wp_head', 'logo_site_img'); //Remove Widget Default function wo_unregister_default_wp_widgets() { unregister_widget('WP_Widget_Search'); } add_action('widgets_init', 'wo_unregister_default_wp_widgets', 1); /* @Limita o tamanho de fonte das tags do widget tag cloud */ function limit_font_size_tag_cloud() { $args = array( 'smallest' => 10, 'largest' => 16, 'orderby' => 'count', //'format' => 'list' //Mostra como uma lista ); return $args; } add_filter('widget_tag_cloud_args', 'limit_font_size_tag_cloud'); //Registra os Widget if ( function_exists('register_sidebar')){ register_sidebar(array( 'name'=>'Sidebar Home', 'description' => '', 'id' => 'sidebar-home', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="sidebar-title">', 'after_title' => '</h2>', )); register_sidebar(array( 'name'=>'Menu Lateral', 'description' => 'Usado em todas as páginas exceto na home.', 'id' => 'menu-lateral', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="sidebar-title">', 'after_title' => '</h2>', )); register_sidebar(array( 'name'=>'Footer 1', 'description' => 'Combinar Widgets nas áreas footer 1, 2, 3 e 4 produzirá efeitos diferenciados.', 'id' => 'footer-1', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="sidebar-title-footer">', 'after_title' => '</h2>', )); register_sidebar(array( 'name'=>'Footer 2', 'description' => '', 'id' => 'footer-2', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="sidebar-title-footer">', 'after_title' => '</h2>', )); register_sidebar(array( 'name'=>'Footer 3', 'description' => '', 'id' => 'footer-3', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="sidebar-title-footer">', 'after_title' => '</h2>', )); register_sidebar(array( 'name'=>'Footer 4', 'description' => '', 'id' => 'footer-4', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="sidebar-title-footer">', 'after_title' => '</h2>', )); } /* * Classes css especiais para widgets footer. * A largura dos widgets será calculada com base em quantos estão ativos */ if ( ! function_exists( 'zinm3_footer_widget_class' ) ): function zinm3_footer_widget_class() { $count = 0; if ( is_active_sidebar( 'footer-1' ) ) $count++; if ( is_active_sidebar( 'footer-2' ) ) $count++; if ( is_active_sidebar( 'footer-3' ) ) $count++; if ( is_active_sidebar( 'footer-4' ) ) $count++; $class = ''; switch ( $count ) { case '1': $class = 'widget-ativo-1'; break; case '2': $class = 'widget-ativos-2'; break; case '3': $class = 'widget-ativos-3'; break; case '4': $class = 'widget-ativos-4'; break; } if ( $class ) echo 'class="' . $class . '"'; } endif; //Css especial para quando os widgets do footer estão sendo usados. if ( ! function_exists( 'zinm3_widget_footer_ativo' ) ): add_action( 'wp_print_styles', 'zinm3_widget_footer_ativo' ); function zinm3_widget_footer_ativo(){ if ( is_active_sidebar( 'footer-1' ) || is_active_sidebar( 'footer-2' ) || is_active_sidebar( 'footer-3' ) || is_active_sidebar( 'footer-4' ) ) { wp_enqueue_style('footer-style', get_template_directory_uri(). '/css/footer-ativo.css', false, 1.0); } } endif; /* * Exibe o nome ou link do autor do post * com base na opção escolhida no painel admin do tema. */ if ( ! function_exists( 'post_info_autores' ) ): function post_info_autores(){ $autor = get_option('zinm3_autores'); switch($autor){ case '': return false; break; case 'autor': echo 'por: '; the_author(); break; case 'autores': echo 'por: '; the_author_posts_link(); break; } } endif; /* Tratamento da Busca Avançada */ if ( ! function_exists( 'wo_search_posts_filter' ) ): function wo_search_posts_filter($query) { //Opções permitidas $options = array( 'all', 'zinm3_post_blog', 'zinm3_noticia', 'pages' ); //Verificação das opções permitidas if( isset( $_GET['tipo'] ) AND ( array_search( $_GET['tipo'], $options) !== false ) ){ $metodo = trim((int)isset( $_GET['tipo'] )); } else { return; } //Opções permitidas para resultados por página. $n = array( '5', '10', '15', '20' ); //Pega o campo Resultados por página. if( isset( $_GET['np'] ) AND is_numeric( $_GET['np'] ) AND ( array_search( $_GET['np'], $n) !== false )){ $n = trim($_GET['np'] ); } else { return; } //Pega o campo Categorias if( isset( $_GET['cats'] ) AND is_numeric( $_GET['cats'] ) ){ $cat = trim($_GET['cats'] ); } //Pega o campo Tag if( isset( $_GET['tags'] ) AND is_numeric( $_GET['tags'] ) ){ $tag = trim($_GET['tags'] ); } //Pega o campo Cidade if( isset( $_GET['taxcats'] ) AND is_numeric( $_GET['taxcats'] ) ){ $taxcat = trim($_GET['taxcats'] ); } //Pega o campo editoria if( isset( $_GET['taxcats2'] ) AND is_numeric( $_GET['taxcats2'] ) ){ $taxcat2 = trim($_GET['taxcats2'] ); } //Faz a filtragem com os parâmetro recebidos. if ($query->is_search && isset($metodo) ) { if( $_GET['tipo'] != 'all' ){ if( $_GET['tipo'] == 'pages' ){ $query->set( 'post_type','page' ); $query->set( 'posts_per_page', $n ); if (isset($cat) ) { $query->set( 'cat', $cat ); } if (isset($tag) ) { $query->set( 'tag_id', $tag ); } } elseif( $_GET['tipo'] == 'zinm3_post_blog' ){ $query->set( 'meta_value', 'zinm3_post_blog' ); $query->set( 'posts_per_page', $n ); if (isset($cat) ) { $query->set( 'cat', $cat ); } if (isset($tag) ) { $query->set( 'tag_id', $tag ); } //Se o campo categoria e tag de produto foi selecionado /* if (isset($taxcat) ) { $categoria_args['tax_query'] = array('taxonomy' => 'cidade', 'field' => 'id', 'terms' => $taxcat, 'operator' => 'AND' ); $query->set( 'tax_query', $categoria_args ); } */ //Se o campo cidade e editoria foi selecionado if ( isset($taxcat) && isset($taxcats2) ) { $my_args = array('relation' => 'AND', array('taxonomy' => 'cidade', 'field' => 'id', 'terms' => $taxcats ), array('taxonomy' => 'editoria', 'field' => 'id', 'terms' => $taxcats2, 'operator' => 'IN', ) ); $query->set( 'tax_query', $my_args ); //Se só o campo cidade foi selecionado } elseif (isset($taxcats) ) { $categoria_args['tax_query'] = array('taxonomy' => 'cidade', 'field' => 'id', 'terms' => $taxcats, 'operator' => 'AND' ); $query->set( 'tax_query', $categoria_args ); //Se só o campo editoria } elseif (isset($taxcats2) ) { $categoria_args['tax_query'] = array('taxonomy' => 'editoria', 'field' => 'id', 'terms' => $taxcats2, 'operator' => 'AND' ); $query->set( 'tax_query', $categoria_args ); } } elseif( $_GET['tipo'] == 'zinm3_noticia' ){ $query->set( 'meta_value' , 'zinm3_noticia' ); $query->set( 'posts_per_page', $n ); if (isset($cat) ) { $query->set( 'cat', $cat ); } if (isset($tag) ) { $query->set( 'tag_id', $tag ); } //Se o campo categoria e tag de produto foi selecionado /* if (isset($taxcat) ) { $categoria_args['tax_query'] = array('taxonomy' => 'cidade', 'field' => 'id', 'terms' => $taxcat, 'operator' => 'AND' ); $query->set( 'tax_query', $categoria_args ); } */ //Se o campo cidade e editoria foi selecionado if ( isset($taxcat) && isset($taxcats2) ) { $my_args = array('relation' => 'AND', array('taxonomy' => 'cidade', 'field' => 'id', 'terms' => $taxcats ), array('taxonomy' => 'editoria', 'field' => 'id', 'terms' => $taxcats2, 'operator' => 'IN', ) ); $query->set( 'tax_query', $my_args ); //Se só o campo cidade foi selecionado } elseif (isset($taxcats) ) { $categoria_args['tax_query'] = array('taxonomy' => 'cidade', 'field' => 'id', 'terms' => $taxcats, 'operator' => 'AND' ); $query->set( 'tax_query', $categoria_args ); //Se só o campo editoria } elseif (isset($taxcats2) ) { $categoria_args['tax_query'] = array('taxonomy' => 'editoria', 'field' => 'id', 'terms' => $taxcats2, 'operator' => 'AND' ); $query->set( 'tax_query', $categoria_args ); } } } else { if( $_GET['tipo'] == 'all' ){ $query->set( 'posts_per_page', $n ); if (isset($cat) ) { $query->set( 'cat', $cat ); } if (isset($tag) ) { $query->set( 'tag_id', $tag ); } //Se o campo categoria e tag de produto foi selecionado if (isset($taxcat) ) { $categoria_args['tax_query'] = array('taxonomy' => 'cidade', 'field' => 'id', 'terms' => $taxcat, 'operator' => 'AND' ); $query->set( 'tax_query', $categoria_args ); } } } } return $query; } add_filter('pre_get_posts' , 'wo_search_posts_filter'); endif; //Select de Categorias function dropdown_cat_select(){ ?> <select id="otera_dropdown_cat_select" name="cats"> <option value="">-- Categorias --</option> <?php $check = (isset($_GET['cats'])) ? $_GET['cats']: ''; $categories = get_categories('hierarchical=0'); foreach($categories as $category){ ?> <option value="<?php echo $category->cat_ID; ?>"<?php selected($check , $category->cat_ID ); ?>><?php echo "$category->cat_name"; echo " ($category->count)"; ?></option> <?php } ?> </select> <?php } //Select de Tags function dropdown_tag_select(){ ?> <select id="otera_dropdown_tag_select" class="tags" name="tags"> <option value="">-- Tags --</option> <?php $check = (isset($_GET['tags'])) ? $_GET['tags']: ''; $alltags = array(); $alltags = get_tags(); foreach ($alltags as $tag) { ?> <option value="<?php echo $tag->term_id; ?>"<?php selected($check , $tag->term_id ); ?>><?php echo "$tag->name"; echo " ($tag->count)"; ?></option> <?php } ?> </select> <?php } //Select de Taxonomia cidades function dropdown_cat_taxonomia_select(){ ?> <select id="otera_dropdown_tax_cat_select" name="taxcats"> <option value="">-- Cidades --</option> <?php $check = (isset($_GET['taxcats'])) ? $_GET['taxcats']: ''; $categories = get_categories('hierarchical=0&taxonomy=cidade'); foreach($categories as $category){ ?> <option value="<?php echo $category->cat_ID; ?>"<?php selected($check , $category->cat_ID ); ?>><?php echo "$category->cat_name"; echo " ($category->count)"; ?></option> <?php } ?> </select> <?php } //Select de Taxonomia editorias function dropdown_cat_taxonomia_editoria_select(){ ?> <select id="otera_dropdown_tax_cat_select2" name="taxcats2"> <option value="">-- Editoria --</option> <?php $check = (isset($_GET['taxcats2'])) ? $_GET['taxcats2']: ''; $categories = get_categories('hierarchical=0&taxonomy=editoria'); foreach($categories as $category){ ?> <option value="<?php echo $category->cat_ID; ?>"<?php selected($check , $category->cat_ID ); ?>><?php echo "$category->cat_name"; echo " ($category->count)"; ?></option> <?php } ?> </select> <?php } //Comentários do Tema if ( ! function_exists( 'my_theme_comment' ) ): function my_theme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div id="comment-<?php comment_ID(); ?>" class="comment-body"> <div class="box-avatar"> <?php echo get_avatar( $comment , $size='65' ); ?> </div> <div class="comment-box"> <span class="comment-info"> <?php echo get_comment_author_link(); ?> <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"> <span><?php echo get_comment_date('m/d/Y');?> - <?php echo get_comment_time(); ?></span></a> </span> <div class="content-comment"> <?php if ($comment->comment_approved == '0') : ?><p class="aviso"><em>Seu comentário está aguardando moderação.</em></p><?php endif; ?> <?php comment_text() ?> <br clear="all" /> <?php edit_comment_link(' Editar ',' ',' ') ?> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div><!--content-comment--> </div><!--comment-box--> </div><!--comment-body--> <br clear="all" /> <?php } endif; //Cria post Custom Chamado de Post Slide. if ( ! function_exists( 'zinm3_create_post_type' ) ): add_action( 'init', 'zinm3_create_post_type' ); function zinm3_create_post_type() { register_post_type( 'post_slide', array( 'labels' => array( 'name' => 'Post Slides', 'singular_name' => 'Post Slide', 'add_new' => 'Novo Post Slide', 'add_new_item' => 'Adicionar Novo Post Slide', 'edit_item' => 'Editar Post Slide', 'new_item' => 'Novo Post Slide' ), 'public' => true, 'menu_position' => 5, 'supports' => array( 'title' , 'editor' , 'excerpt' , 'comments' , 'thumbnail', 'custom-fields' ), 'exclude_from_search' => true, 'rewrite' => array('slug' => 'destaque') ) ); } endif; function my_rewrite_flush() { zinm3_create_post_type(); flush_rewrite_rules(); } register_activation_hook(__FILE__, 'my_rewrite_flush'); //Adiciona menu de navegação personalizado if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array( 'menu_superior' => '<strong>Menu Superior</strong>', 'menu_superior_secundario' => '<strong>Menu superior Secundário</strong><br />Com Suporte a Submenus.', 'menu_superior_principal' => '<strong>Menu Principal</strong><br />Com suporte a Descrição.', 'menu_footer' => '<strong>Menu Rodapé</strong>' ) ); } //Aviso para a tela de menus sobre o recurso descrição. if(get_option('zinm3_menu_aviso') != true ) { function description_usability_menus(){ if ( is_admin() ) { $pagina_atual = get_current_screen(); if( $pagina_atual->id == 'nav-menus' ) { echo '<style type="text/css">.aviso_menu_description{ font-family: Arial,"Bitstream Vera Sans",Helvetica,Verdana,sans-serif; font-size: 13px; margin:25px 15px 0 15px; padding: 5px 10px; -moz-border-radius: 6px; -khtml-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; background: #FFFBCC; border: #E6DB55 solid 1px;}</style>'; echo '<div class="aviso_menu_description">Ao adicionar itens a um menu à propriedade <strong>descrição</strong> é automaticamente preenchida com o conteúdo do item.<br /> Portanto, é essencial editar a descrição para os itens do menu que for criado para a área <strong>Menu Principal</strong>. <br /><small>Você pode remover este aviso na tela Opções do tema em avisos administrativos.</small></div>'; } } } add_action( 'admin_notices', 'description_usability_menus'); } //Abilitando descrição do menu personalizado class description_walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="'. esc_attr( $class_names ) . '"'; $output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $class_names .'>'; $prepend = '<span class="menu_link">'; $append = '</span>'; $attributes = ! empty( $item->attr_title ) ? ' title="'. esc_attr( $item->attr_title ) .'"' : ''; $attributes .= ! empty( $item->target ) ? ' target="'. esc_attr( $item->target ) .'"' : ''; $attributes .= ! empty( $item->xfn ) ? ' rel="'. esc_attr( $item->xfn ) .'"' : ''; $attributes .= ! empty( $item->url ) ? ' href="'. esc_attr( $item->url ) .'"' : ''; $description = ! empty( $item->description ) ? "<span class=\"menu-description\">".esc_attr( $item->description )." </span>" : ''; if($depth != 0){ $description = $append = $prepend = ""; } $item_output = $args->before; $item_output .= '<a'. $attributes .'>'; $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append; $item_output .= $description.$args->link_after; $item_output .= '</a>'; $item_output .= $args->after; $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); } } //Adiciona os campos extras, imagem e subtítulo para categorias add_action ( 'edit_category_form_fields', 'extra_category_fields'); function extra_category_fields( $tag ) { $t_id = $tag->term_id; $cat_meta = get_option( "category_$t_id"); ?> <tr class="form-field"> <th scope="row" valign="top"><label for="cat_meta[img]">Imagem url<br /><small>Campo Opcional</small></label></th> <td> <textarea name="cat_meta[img]" id="cat_meta[img]" style="width:97%;"><?php echo $cat_meta['img'] ? $cat_meta['img'] : ''; ?></textarea><br /> <span class="description">Essa imagem será usada na página categorias e não deve exceder <strong>620 pixels</strong> de largura.</span><br /> <?php if ( $cat_meta['img'] ){ ?> <?php echo $cat_meta[ <?php } else { echo '<h3>Se a url for digitada corretamente sua imagem deve aparecer aqui.</h3>'; } ?> </td> </tr> <tr class="form-field"> <th scope="row" valign="top"><label for="cat_meta[subtitle]">Subtítulo<br /><small>Campo Opcional</small></label></th> <td> <input type="text" name="cat_meta[subtitle]" id="cat_meta[subtitle]" size="40" value="<?php echo $cat_meta['subtitle'] ? $cat_meta['subtitle'] : ''; ?>"><br /> <span class="description">O subtítulo será usado em algumas áreas como home e página de categorias.</span> </td> </tr> <?php } //Salva os novos campos para categorias add_action ( 'edited_category', 'save_extra_category_fileds'); function save_extra_category_fileds( $term_id ) { if ( isset( $_POST['cat_meta'] ) ) { $t_id = $term_id; $cat_meta = get_option( "category_$t_id"); $cat_keys = array_keys($_POST['cat_meta']); foreach ($cat_keys as $key){ if (isset($_POST['cat_meta'][$key])){ $cat_meta[$key] = $_POST['cat_meta'][$key]; } } delete_option( "category_$t_id" ); update_option( "category_$t_id", $cat_meta ); } } add_action( 'init', 'register_taxonomy_cidade' ); function register_taxonomy_cidade() { $labels = array( 'name' => _x( 'Cidades', 'cidade' ), 'singular_name' => _x( 'Cidade', 'cidade' ), 'search_items' => _x( 'Search Cidades', 'cidade' ), 'popular_items' => _x( 'Popular Cidades', 'cidade' ), 'all_items' => _x( 'All Cidades', 'cidade' ), 'parent_item' => _x( 'Parent Cidade', 'cidade' ), 'parent_item_colon' => _x( 'Parent Cidade:', 'cidade' ), 'edit_item' => _x( 'Edit Cidade', 'cidade' ), 'update_item' => _x( 'Update Cidade', 'cidade' ), 'add_new_item' => _x( 'Add New Cidade', 'cidade' ), 'new_item_name' => _x( 'New Cidade Name', 'cidade' ), 'separate_items_with_commas' => _x( 'Separate cidades with commas', 'cidade' ), 'add_or_remove_items' => _x( 'Add or remove cidades', 'cidade' ), 'choose_from_most_used' => _x( 'Choose from the most used cidades', 'cidade' ), 'menu_name' => _x( 'Cidades', 'cidade' ), ); $args = array( 'labels' => $labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true ); register_taxonomy( 'cidade', array('post'), $args ); } add_action( 'init', 'register_taxonomy_editoria' ); function register_taxonomy_editoria() { $labels = array( 'name' => _x( 'Editorias', 'editoria' ), 'singular_name' => _x( 'Editoria', 'editoria' ), 'search_items' => _x( 'Search Editorias', 'editoria' ), 'popular_items' => _x( 'Popular Editorias', 'editoria' ), 'all_items' => _x( 'All Editorias', 'editoria' ), 'parent_item' => _x( 'Parent Editoria', 'editoria' ), 'parent_item_colon' => _x( 'Parent Editoria:', 'editoria' ), 'edit_item' => _x( 'Edit Editoria', 'editoria' ), 'update_item' => _x( 'Update Editoria', 'editoria' ), 'add_new_item' => _x( 'Add New Editoria', 'editoria' ), 'new_item_name' => _x( 'New Editoria Name', 'editoria' ), 'separate_items_with_commas' => _x( 'Separate editorias with commas', 'editoria' ), 'add_or_remove_items' => _x( 'Add or remove editorias', 'editoria' ), 'choose_from_most_used' => _x( 'Choose from the most used editorias', 'editoria' ), 'menu_name' => _x( 'Editorias', 'editoria' ), ); $args = array( 'labels' => $labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'hierarchical' => true, 'rewrite' => true, 'query_var' => true ); register_taxonomy( 'editoria', array('post'), $args ); } ?>

Can't see the comments? Please login first :)