Commit e4387d20 authored by Benthe Kuijpers's avatar Benthe Kuijpers
Browse files

add custom post types for resources and events + taxonomies

parent f043f131
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
......@@ -8,4 +11,5 @@ RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
const { series } = require('gulp');
var project_name = 'makeitopen', // Project name, used for build
url = 'http://localhost:8000/'; // Local Development URL for BrowserSync
url = 'http://localhost:8181/'; // Local Development URL for BrowserSync
const gulp = require('gulp')
const jshint = require('gulp-jshint')
......
......@@ -33,6 +33,11 @@ function makeitopen_scripts() {
add_action( 'wp_enqueue_scripts', 'makeitopen_scripts' );
/**
* Functions which enhance the theme by hooking into WordPress.
* MIO custom global functions
*/
require get_template_directory() . '/inc/template-functions.php';
/**
* MIO Custom Post Types
*/
require get_template_directory() . '/inc/custom-post-types.php';
<?php
function mio_custom_post_types() {
$args = array(
'public' => true,
'menu_icon' => 'dashicons-media-default',
'labels' => array(
'name' => __( 'Resources' ),
'singular_name' => __( 'Resource' ),
'add_new_item' => __( 'Add new resource' ),
'add_new' => __('New resource'),
'edit_item' => __( 'Edit resource' ),
'all_items' => __( 'All resources' ),
'view_item' => __( 'View resource' )
),
'hierarchical' => true,
'has_archive' => false,
'supports' => array( 'title', 'editor', 'author' )
);
register_post_type( 'resources', $args );
$args = array(
'public' => true,
'menu_icon' => 'dashicons-calendar',
'labels' => array(
'name' => __( 'Events' ),
'singular_name' => __( 'Event' ),
'add_new_item' => __( 'Add new event' ),
'add_new' => __('New event'),
'edit_item' => __( 'Edit event' ),
'all_items' => __( 'All events' ),
'view_item' => __( 'View event' )
),
'hierarchical' => true,
'has_archive' => false,
'supports' => array( 'title', 'editor', 'author' )
);
register_post_type( 'events', $args );
}
add_action( 'init', 'mio_custom_post_types' );
function mio_custom_taxonomies() {
$args = array(
'hierarchical' => true,
'labels' => array(
'name' => __( 'Resource types', 'taxonomy general name'),
'singular_name' => __( 'Resource type', 'taxonomy singular name'),
'add_new_item' => __( 'Add new resource type' ),
'new_item_name' => __( 'New resource type' ),
'view_item' => __( 'View resource type' ),
'edit_item' => __( 'Edit resource type' )
)
);
register_taxonomy('resource-types', 'resources', $args);
$args = array(
'hierarchical' => true,
'labels' => array(
'name' => __( 'Event categories', 'taxonomy general name'),
'singular_name' => __( 'Event category', 'taxonomy singular name'),
'add_new_item' => __( 'Add new event category' ),
'new_item_name' => __( 'New event category' ),
'view_item' => __( 'View event category' ),
'edit_item' => __( 'Edit event category' )
)
);
register_taxonomy('event-categories', 'events', $args);
}
add_action( 'init', 'mio_custom_taxonomies', 0);
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment