Files
igny8/igny8-wp-plugin/templates/single-igny8-content.php
IGNY8 VPS (Salman) a38626ba67 wp content temalpate
2025-12-01 11:05:22 +00:00

80 lines
2.6 KiB
PHP

<?php
/**
* Single Post Template for IGNY8-Generated Content
*
* This template is automatically loaded for posts that have _igny8_content_id meta.
* It mirrors the design of the IGNY8 app content view template.
*
* @package Igny8Bridge
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Load template functions
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/template-functions.php';
get_header();
// Get IGNY8 metadata
$content_id = get_post_meta(get_the_ID(), '_igny8_content_id', true);
$task_id = get_post_meta(get_the_ID(), '_igny8_task_id', true);
$content_type = get_post_meta(get_the_ID(), '_igny8_content_type', true);
$structure = get_post_meta(get_the_ID(), '_igny8_content_structure', true);
$source = get_post_meta(get_the_ID(), '_igny8_source', true);
$primary_keyword = get_post_meta(get_the_ID(), '_igny8_primary_keyword', true);
$secondary_keywords = get_post_meta(get_the_ID(), '_igny8_secondary_keywords', true);
$cluster_name = get_post_meta(get_the_ID(), '_igny8_cluster_name', true);
$cluster_id = get_post_meta(get_the_ID(), '_igny8_cluster_id', true);
$sector_id = get_post_meta(get_the_ID(), '_igny8_sector_id', true);
$meta_title = get_post_meta(get_the_ID(), '_igny8_meta_title', true);
$meta_description = get_post_meta(get_the_ID(), '_igny8_meta_description', true);
$last_synced = get_post_meta(get_the_ID(), '_igny8_last_synced', true);
// Parse secondary keywords
$keywords_array = igny8_parse_keywords($secondary_keywords);
// Get WordPress data
$categories = get_the_category();
$tags = get_the_tags();
$word_count = igny8_calculate_word_count(get_the_content());
$status = get_post_status();
// Get images
$featured_image_id = get_post_thumbnail_id();
$in_article_images = igny8_get_in_article_images(get_the_ID());
$featured_image_prompt = igny8_get_featured_image_prompt(get_the_ID());
// Parse content into sections
$content = get_the_content();
$content = apply_filters('the_content', $content);
$parsed_content = igny8_parse_content_sections($content);
?>
<div class="igny8-content-wrapper">
<div class="igny8-content-container">
<?php
// Header with metadata
include plugin_dir_path(__FILE__) . 'parts/igny8-header.php';
// Featured image (if exists)
if ($featured_image_id) {
include plugin_dir_path(__FILE__) . 'parts/igny8-featured-image.php';
}
// Content sections
include plugin_dir_path(__FILE__) . 'parts/igny8-content-sections.php';
// Metadata footer
include plugin_dir_path(__FILE__) . 'parts/igny8-metadata.php';
?>
</div>
</div>
<?php
get_footer();