Created
November 10, 2014 12:13
-
-
Save rodica-andronache/2b5ad9d4fe6fc9d50999 to your computer and use it in GitHub Desktop.
Inregistrare custom post type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'init', 'zerif_create_post_type' ); | |
| function zerif_create_post_type() { | |
| /* portofolio */ | |
| register_post_type( 'portofolio', | |
| array( | |
| 'labels' => array( | |
| 'name' => __( 'Portofolio','zerif' ), | |
| 'singular_name' => __( 'Portofolio','zerif' ) | |
| ), | |
| 'public' => true, | |
| 'has_archive' => true, | |
| 'taxonomies' => array('category'), | |
| 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ), | |
| 'show_ui' => true, | |
| ) | |
| ); | |
| /* testimonial */ | |
| register_post_type( 'testimonial', | |
| array( | |
| 'labels' => array( | |
| 'name' => __( 'Testimonial','zerif' ), | |
| 'singular_name' => __( 'Testimonial','zerif' ) | |
| ), | |
| 'public' => true, | |
| 'has_archive' => true, | |
| 'taxonomies' => array('post_tag'), | |
| 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ), | |
| 'show_ui' => true, | |
| ) | |
| ); | |
| } | |
| add_action('after_switch_theme', 'zerif_flush'); | |
| function zerif_flush () { | |
| flush_rewrite_rules(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment