Skip to content

Commit 6989b97

Browse files
author
Ariel Jolo
committed
Converting /ai to a FSE ready site
1 parent 8f6d232 commit 6989b97

File tree

2 files changed

+1290
-1
lines changed

2 files changed

+1290
-1
lines changed

themes/osi/functions.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,4 +449,25 @@ function save_form_data_to_cpt($contact_form) {
449449
} else {
450450
error_log('WPCF7_Submission instance is null.');
451451
}
452-
}
452+
}
453+
454+
455+
456+
457+
458+
function osi_register_block_template() {
459+
$post_type = 'page'; // Apply to the "page" post type
460+
$template_slug = 'ai-template';
461+
$template_file = 'templates/ai-template.html'; // Path to your block template file
462+
463+
// Register the block template
464+
register_block_template(
465+
$post_type,
466+
[
467+
'title' => __('AI Template', 'osi'),
468+
'slug' => $template_slug,
469+
'path' => get_theme_file_path($template_file),
470+
]
471+
);
472+
}
473+
add_action('init', 'osi_register_block_template');

0 commit comments

Comments
 (0)