0
Colleagues.
I am trying to touch Wordpress and confess that I am taking a huge beating. I have to create one more item in the menu in the Wordpress manager ( wp-admin ) and I saw that I have to create, if I’m not mistaken, inside the functions.php file, but I’m not sure how to create. I have a model that was created by the previous colleague who did so:
/************ ALBUM REGISTER***********/
add_action('init', 'album_register');
register_taxonomy('album', 'album', array('hierarchical' => true, 'label' => 'Categorias de Album', 'query_var' => true, 'rewrite' => true));
function album_register() {
$labels = array(
'name' => _x('album', 'post type general name'),
'singular_name' => _x('album', 'post type singular name'),
'add_new' => _x('Adicionar Album', 'Vereador'),
'add_new_item' => __('Adicionar Album'),
'edit_item' => __('Editar Album'),
'new_item' => __('Adicionar Album'),
'view_item' => __('Visualizar Album'),
'search_items' => __('Procurar Album'),
'not_found' => __('Nothing found'),
'not_found_in_trash' => __('Nothing found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
//'menu_icon' => get_stylesheet_directory_uri() . '/imagens/vereadores.png',
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail')
);
register_post_type( 'album' , $args );
}
/************ END ALBUM REGISTER***********/
How would I create an item called paychecks and direct to the paychecks page.php?
Thank you!
I put this code, but now all pages appear Fatal error: Call to Undefined Function add_menu_page() in /cmni.rj.Gov.br/www/wp-content/themes/website/functions.php on line 92 and I can’t edit functions.php. How would I fix it?
– user24136
@Jose.Marcos this code is an example of functionality. It is of paramount importance that you have access to ftp for this change. It is also worth checking if this code works in your version of Wordpres and check if it has been placed in the right place.
– Otto
I have access to FTP. How would I fix?
– user24136
open the file and remove the code
– Otto
Perfect Otto. I did it. Thank you. About your code, I’m sorry, I’m just a layman. The error you gave was in relation to this add_menu_page method().
– user24136
@Jose.Marcos if you check in the wordpress Codex he day to use this way. http://codex.wordpress.org/Function_Reference/add_menu_page Are you using an updated version ? And also every code implementation test do in a part installation to not have these problems
– Otto
WP is 3.3.2. This system already existed here in the company. The person implemented, but then left and we are struggling to move, because we do not know much WP.
– user24136