Im Getting a couple of warnings when creating custom post types, someone referred me to using a plug in but since i'm new to this i want to know what is going on so i want to do it manually. This are the warnings i get.
Warning: Missing argument 2 for _x(), called in C:\xampp\htdocs\wordpress\wp-content\themes\posttypes.php on line 8 and defined in C:\xampp\htdocs\wordpress\wp-includes\l10n.php on line 189
Warning: Missing argument 2 for _x(), called in C:\xampp\htdocs\wordpress\wp-content\themes\posttypes.php on line 9 and defined in C:\xampp\htdocs\wordpress\wp-includes\l10n.php on line 189
Warning: Missing argument 2 for _x(), called in C:\xampp\htdocs\wordpress\wp-content\themes\posttypes.php on line 28 and defined in C:\xampp\htdocs\wordpress\wp-includes\l10n.php on line 189
Warning: Missing argument 2 for _x(), called in C:\xampp\htdocs\wordpress\wp-content\themes\posttypes.php on line 29 and defined in C:\xampp\htdocs\wordpress\wp-includes\l10n.php on line 189
Warning: Missing argument 2 for _x(), called in C:\xampp\htdocs\wordpress\wp-content\themes\posttypes.php on line 48 and defined in C:\xampp\htdocs\wordpress\wp-includes\l10n.php on line 189
Warning: Missing argument 2 for _x(), called in C:\xampp\htdocs\wordpress\wp-content\themes\posttypes.php on line 49 and defined in C:\xampp\htdocs\wordpress\wp-includes\l10n.php on line 189
Here is my code
<?php
//Add new post type for Models
add_action('init', 'models_portfolio_init');
function models_portfolio_init()
{
$args = array(
'label' => _x('Models'),
'singular_label' => _x('Models'),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','comments')
);
register_post_type('recipes',$args);
}
//Add new post type for Books
add_action('init', 'books_posts_init');
function books_posts_init()
{
$args = array(
'label' => _x('Books'),
'singular_label' => _x('Books'),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','comments')
);
register_post_type('books',$args);
}
//Add new post type for Advertisements
add_action('init', 'advertisements_init');
function advertisements_init()
{
$args = array(
'label' => _x('Advertisements'),
'singular_label' => _x('Advertisements'),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','comments')
);
register_post_type('advertisements',$args);
}
?>