upskill-event-manager/templates/page-master-dashboard.php
bengizmo a1abbf1577 fix: Resolve duplicate content and raw shortcode display on manage event page
- Strip WordPress block editor comments (<\!-- wp:shortcode -->) from content
- Prevent duplicate header rendering when using page template vs shortcode
- Add conditional header rendering based on URL path to avoid duplication
- Header now only renders for non-hierarchical URLs where template isn't used

The manage event page was showing duplicate "Create and Manage Your HVAC Training Events"
sections and raw block editor comments because both the template and the header class
were outputting content, and block editor wrapper comments weren't being stripped.

Co-Authored-By: Ben Reed <ben@tealmaker.com>
2025-07-30 10:06:49 -03:00

29 lines
No EOL
899 B
PHP

<?php
/**
* Template Name: Master Dashboard
* Description: Template for the master trainer dashboard page
*/
get_header();
// Debug output
echo '<!-- page-master-dashboard.php template loaded -->';
echo '<!-- Page ID: ' . get_the_ID() . ' -->';
echo '<!-- Page Title: ' . get_the_title() . ' -->';
// Force render the master dashboard content directly
if (class_exists('HVAC_Community_Events')) {
$hvac = HVAC_Community_Events::get_instance();
if (method_exists($hvac, 'render_master_dashboard')) {
echo '<!-- Calling render_master_dashboard directly -->';
echo $hvac->render_master_dashboard();
} else {
echo '<!-- render_master_dashboard method not found -->';
echo do_shortcode('[hvac_master_dashboard]');
}
} else {
echo '<!-- HVAC_Community_Events class not found -->';
echo do_shortcode('[hvac_master_dashboard]');
}
get_footer();