From 9737a7c310aa522fb076bbb901eed00f5663e2d3 Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Wed, 26 Apr 2017 22:00:56 +0200 Subject: [PATCH] Add person custom post type --- .htaccess | 4 +- wp-content/themes/ku2015/functions.php | 9 + .../themes/ku2015/inc/post_type_person.php | 175 ++++++++++++++++++ wp-content/themes/ku2015/template-persons.php | 38 ++++ 4 files changed, 224 insertions(+), 2 deletions(-) create mode 100644 wp-content/themes/ku2015/inc/post_type_person.php create mode 100644 wp-content/themes/ku2015/template-persons.php diff --git a/.htaccess b/.htaccess index f2c0b5a..2b77e40 100644 --- a/.htaccess +++ b/.htaccess @@ -1,7 +1,7 @@ RewriteEngine On -RewriteBase /tn/ +RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule . /tn/index.php [L] +RewriteRule . /index.php [L] diff --git a/wp-content/themes/ku2015/functions.php b/wp-content/themes/ku2015/functions.php index 103c1c4..3075a90 100644 --- a/wp-content/themes/ku2015/functions.php +++ b/wp-content/themes/ku2015/functions.php @@ -177,3 +177,12 @@ add_filter("get_archives_link", "get_archives_for_category"); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'], $instance, $this->id_base ); */ + +/* Include person custom post type */ +require get_template_directory() . '/inc/post_type_person.php'; + +function ku_custom_post_types() { + global $KU_TYPES; + $KU_TYPES['person'] = new KUPerson(); +} +add_action('init', 'ku_custom_post_types', 0); \ No newline at end of file diff --git a/wp-content/themes/ku2015/inc/post_type_person.php b/wp-content/themes/ku2015/inc/post_type_person.php new file mode 100644 index 0000000..209e14e --- /dev/null +++ b/wp-content/themes/ku2015/inc/post_type_person.php @@ -0,0 +1,175 @@ + + +

+ get_html($post_id, $key), + 'ku-person-section', + $settings=array('textarea_name' => $key)); + ?> + + + + + + + + $c_label) { + $selected = $val == $c_val ? ' selected' : ''; + $options .= ""; + } + ?> + + +