Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

custom post type

.wp-block-code {
	border: 0;
	padding: 0;
}

.wp-block-code > div {
	overflow: auto;
}

.hljs {
	box-sizing: border-box;
}

.hljs.shcb-code-table {
	display: table;
	width: 100%;
}

.hljs.shcb-code-table > .shcb-loc {
	color: inherit;
	display: table-row;
	width: 100%;
}

.hljs.shcb-code-table .shcb-loc > span {
	display: table-cell;
}

.wp-block-code code.hljs:not(.shcb-wrap-lines) {
	white-space: pre;
}

.wp-block-code code.hljs.shcb-wrap-lines {
	white-space: pre-wrap;
}

.hljs.shcb-line-numbers {
	border-spacing: 0;
	counter-reset: line;
}

.hljs.shcb-line-numbers > .shcb-loc {
	counter-increment: line;
}

.hljs.shcb-line-numbers .shcb-loc > span {
	padding-left: 0.75em;
}

.hljs.shcb-line-numbers .shcb-loc::before {
	border-right: 1px solid #ddd;
	content: counter(line);
	display: table-cell;
	padding: 0 0.75em;
	text-align: right;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	white-space: nowrap;
	width: 1%;
}
// Register Custom Post Type - Workshop
function kp_workshops() {

	$args = array(
		'label' =>; __( 'Workshop', 'kp_workshops' ),
		'description' =>; __( 'Workshop listing', 'kp_workshops' ),
		'labels' =>; $labels,
		'supports' =>; array( 'title', 'editor', 'thumbnail', 'comments', 'revisions', 'custom-fields' ),
		'taxonomies' =>; array( 'category' ),
		'hierarchical' =>; false,
		'public' =>; true,
		'show_ui' =>; true,
		'show_in_menu' =>; true,
		'menu_position' =>; 20,
		'menu_icon' =>; 'dashicons-welcome-learn-more',
		'show_in_admin_bar' =>; true,
		'show_in_nav_menus' =>; true,
		'can_export' =>; true,
		'has_archive' =>; true,
		'exclude_from_search' =>; false,
		'publicly_queryable' =>; true,
		'capability_type' =>; 'page',
		'show_in_rest' =>; true,
	);

	register_post_type( 'workshops', $args );

}
add_action( 'init', 'kp_workshops', 0 );
Source by krautpress.de #
 
PREVIOUS NEXT
Tagged: #custom #post #type
ADD COMMENT
Topic
Name
4+9 =