_x( 'Schemas', 'post type general name', 'jsgen' ), 'singular_name' => _x( 'Schema', 'post type singular name', 'jsgen' ), 'menu_name' => _x( 'Schemas', 'admin menu', 'jsgen' ), 'name_admin_bar' => _x( 'Schema', 'add new on admin bar', 'jsgen' ), 'add_new' => _x( 'Add New', 'schema', 'jsgen' ), 'add_new_item' => __( 'Add New Schema', 'jsgen' ), 'new_item' => __( 'New Schema', 'jsgen' ), 'edit_item' => __( 'Edit Schema', 'jsgen' ), 'view_item' => __( 'View Schema', 'jsgen' ), 'all_items' => __( 'All Schemas', 'jsgen' ), 'search_items' => __( 'Search Schemas', 'jsgen' ), 'parent_item_colon' => __( 'Parent Schemas:', 'jsgen' ), 'not_found' => __( 'No Schemas found.', 'jsgen' ), 'not_found_in_trash' => __( 'No Schemas found in Trash.', 'jsgen' ) ); $args = array( 'labels' => $labels, 'public' => true, 'menu_icon' => 'dashicons-editor-code', 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array( 'title' ) ); register_post_type( 'json_schema', $args ); } /** * Adds a box to the main column on the Post and Page edit screens. */ function jsgen_add_meta_box() { $screens = array('json_schema' ); foreach ( $screens as $screen ) { add_meta_box( 'jsgen_fields', __( 'JSON Schema', 'jsgen' ), 'jsgen_meta_box_callback', $screen ); add_meta_box( 'jsgen_add_to', __( 'Schema Settings', 'jsgen' ), 'jsgen_add_this_callback', $screen, 'side' ); } } add_action( 'add_meta_boxes_json_schema', 'jsgen_add_meta_box' ); function jsgen_add_this_callback( $post ){ // Add a nonce field so we can check for it later. wp_nonce_field( 'jsgen_meta_box', 'jsgen_meta_box_nonce' ); $genAddTo = get_post_meta( $post->ID, 'genAddTo', true ); $gen_page_ids = maybe_unserialize(get_post_meta( $post->ID, 'gen_page_ids', true)); ?>
> ID, 'genType', true ); $genURL = get_post_meta( $post->ID, 'genURL', true ); $genMapURL = get_post_meta( $post->ID, 'genMapURL', true ); $genEmail = get_post_meta( $post->ID, 'genEmail', true ); $genStreet = get_post_meta( $post->ID, 'genStreet', true ); $genCity = get_post_meta( $post->ID, 'genCity', true ); $genState = get_post_meta( $post->ID, 'genState', true ); $genZip = get_post_meta( $post->ID, 'genZip', true ); $genDescription = get_post_meta( $post->ID, 'genDescription', true ); $genName = get_post_meta( $post->ID, 'genName', true ); $genTelephone = get_post_meta( $post->ID, 'genTelephone', true ); $genDayMo = get_post_meta( $post->ID, 'genDayMo', true ); $genDayTu = get_post_meta( $post->ID, 'genDayTu', true ); $genDayWe = get_post_meta( $post->ID, 'genDayWe', true ); $genDayTh = get_post_meta( $post->ID, 'genDayTh', true ); $genDayFr = get_post_meta( $post->ID, 'genDayFr', true ); $genDaySa = get_post_meta( $post->ID, 'genDaySa', true ); $genDaySu = get_post_meta( $post->ID, 'genDaySu', true ); $genOPHours = get_post_meta( $post->ID, 'genOPHours', true ); $genCLHours = get_post_meta( $post->ID, 'genCLHours', true ); $genLat = get_post_meta( $post->ID, 'genLat', true ); $genLon = get_post_meta( $post->ID, 'genLon', true ); $genGPlus = get_post_meta( $post->ID, 'genGPlus', true ); /* echo ' '; echo ''; */ //echo $gen_code; ?>
Address
>    >    >    >    >    >    >

How to Use:

#1 - Fill out the fields to the left

#2 - Select your Schema Setting on the right

#3 - Publish

#4 - Validate - Click here and enter page URL

Note: Please make sure your theme is using wp_head() function

<!-- JSON Schema Generator created by www.51blocks.com.-->
<script type="application/ld+json">
{
"@context": "https://schema.org"
}
</script>