Skip to content

Instantly share code, notes, and snippets.

@pelagisk
Created August 8, 2012 23:54
Show Gist options
  • Select an option

  • Save pelagisk/3299810 to your computer and use it in GitHub Desktop.

Select an option

Save pelagisk/3299810 to your computer and use it in GitHub Desktop.
Exempel custom post types
<?php
function create_example_post_type() {
$labels = array(
'name' => 'Exempel',
'singular_name' => 'Exempel',
'add_new_item' => 'Lägg till nytt exempel',
'edit_item' => 'Redigera exempel',
'new_item' => 'Nytt exempel',
'view_item' => 'Visa exempel',
'search_items' => 'Sök bland exempel',
'not_found' => 'Inga exempel har lagts till',
'not_found_in_trash' => 'Inga exempel hittades i papperskorgen'
);
$args = array(
'labels' => $labels,
'public' => true,
'show_ui' => true,
'supports' => array('title', 'editor', 'comments')
);
register_post_type( 'exempel', $args );
}
add_action( 'init', 'create_example_post_type' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment