Fail to add support to custom post type
-
I try to follow your FAQ to add below script to my register custom post type (portfolio) but it fails.
I add it like this:
function si_create_post_type_portfolio()
{
$labels = array(
‘name’ => __( ‘Portfolios’,’si_theme’),
‘singular_name’ => __( ‘Portfolio’,’si_theme’ ),
‘add_new’ => __(‘Add New’,’si_theme’),
‘add_new_item’ => __(‘Add New Portfolio’,’si_theme’),
‘edit_item’ => __(‘Edit Portfolio’,’si_theme’),
‘new_item’ => __(‘New Portfolio’,’si_theme’),
‘view_item’ => __(‘View Portfolio’,’si_theme’),
‘search_items’ => __(‘Search Portfolio’,’si_theme’),
‘not_found’ => __(‘No portfolio found’,’si_theme’),
‘not_found_in_trash’ => __(‘No portfolio found in Trash’,’si_theme’),
‘parent_item_colon’ => ”
);$args = array(
‘yarpp_support’ => true
‘labels’ => $labels,
‘public’ => true,
‘exclude_from_search’ => true,
‘publicly_queryable’ => true,
‘show_ui’ => true,
‘query_var’ => true,
‘capability_type’ => ‘post’,
‘hierarchical’ => false,
‘menu_position’ => 5,
‘supports’ => array(‘title’,’editor’,’excerpt’,’thumbnail’,’custom-fields’));
register_post_type(‘portfolio’,$args);
}But after adding it the whole wordpress php corrupts and show this warning message:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘)’ in /home/vivienne/www/www/wp-content/themes/elastico/functions/post-types.php on line 27
I a not really good at php, can you let me know if I have done it wrong????
https://wordpress.org/plugins/yet-another-related-posts-plugin/
- The topic ‘Fail to add support to custom post type’ is closed to new replies.