diff --git a/includes/class-hvac-scripts-styles.php b/includes/class-hvac-scripts-styles.php index df2b50f5..05a13f50 100644 --- a/includes/class-hvac-scripts-styles.php +++ b/includes/class-hvac-scripts-styles.php @@ -86,6 +86,14 @@ class HVAC_Scripts_Styles { $this->version ); + // Page templates styles - ensures proper layout for all HVAC pages + wp_enqueue_style( + 'hvac-page-templates', + HVAC_PLUGIN_URL . 'assets/css/hvac-page-templates.css', + array(), + $this->version + ); + // Dashboard styles if ($this->is_dashboard_page()) { wp_enqueue_style( diff --git a/scripts/assign-all-page-templates.sh b/scripts/assign-all-page-templates.sh new file mode 100755 index 00000000..aabc5cd3 --- /dev/null +++ b/scripts/assign-all-page-templates.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +echo "=== Assigning All Page Templates ===" + +ssh roodev@146.190.76.204 << 'ENDSSH' +cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html + +# Function to set page template by path +set_template_by_path() { + local page_path="$1" + local template="$2" + + # Get page ID by path + page_id=$(wp post list --post_type=page --post_name="$(basename "$page_path")" --post_parent=$(wp post list --post_type=page --post_name="$(dirname "$page_path" | sed 's|/|\n|g' | tail -1)" --field=ID --format=ids) --field=ID --format=ids | head -1) + + if [ -n "$page_id" ]; then + echo "Setting template '$template' for page $page_path (ID: $page_id)..." + wp post meta update "$page_id" "_wp_page_template" "$template" + else + echo "Page not found: $page_path" + fi +} + +# Trainer pages +set_template_by_path "training-login" "page-trainer-login.php" +set_template_by_path "trainer/dashboard" "page-trainer-dashboard.php" +set_template_by_path "trainer/registration" "page-trainer-registration.php" +set_template_by_path "trainer/my-profile" "page-trainer-profile.php" +set_template_by_path "trainer/event/manage" "page-manage-event.php" +set_template_by_path "trainer/event/summary" "page-event-summary.php" +set_template_by_path "trainer/certificate-reports" "page-certificate-reports.php" +set_template_by_path "trainer/generate-certificates" "page-generate-certificates.php" +set_template_by_path "trainer/email-attendees" "page-email-attendees.php" +set_template_by_path "trainer/communication-templates" "page-communication-templates.php" +set_template_by_path "trainer/communication-schedules" "page-communication-schedules.php" +set_template_by_path "trainer/documentation" "page-documentation.php" +set_template_by_path "trainer/attendee-profile" "page-attendee-profile.php" + +# Master trainer pages +set_template_by_path "master-trainer/dashboard" "page-master-dashboard.php" +set_template_by_path "master-trainer/certificate-fix" "page-certificate-fix.php" +set_template_by_path "master-trainer/google-sheets" "page-google-sheets.php" + +# Status pages +set_template_by_path "trainer-account-pending" "page-trainer-account-pending.php" +set_template_by_path "trainer-account-disabled" "page-trainer-account-disabled.php" +set_template_by_path "registration-pending" "page-registration-pending.php" + +# Use simpler method for specific pages we know exist +echo -e "\nUsing direct ID assignment for known pages..." +wp post meta update 5331 "_wp_page_template" "page-trainer-login.php" +wp post meta update 5333 "_wp_page_template" "page-trainer-dashboard.php" +wp post meta update 5334 "_wp_page_template" "page-trainer-registration.php" +wp post meta update 5335 "_wp_page_template" "page-trainer-profile.php" +wp post meta update 5347 "_wp_page_template" "page-master-dashboard.php" + +# Clear cache +wp cache flush +wp breeze purge --cache=all + +echo -e "\n✅ Templates assigned and cache cleared" +ENDSSH \ No newline at end of file diff --git a/scripts/copy-templates-to-theme.sh b/scripts/copy-templates-to-theme.sh new file mode 100755 index 00000000..0e55749a --- /dev/null +++ b/scripts/copy-templates-to-theme.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +echo "=== Copying Templates to Theme Directory ===" + +ssh roodev@146.190.76.204 << 'ENDSSH' +cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html + +# Create hvac-community-events directory in theme +echo "Creating template override directory in theme..." +mkdir -p wp-content/themes/astra/hvac-community-events + +# Copy all page templates +echo "Copying page templates..." +cp wp-content/plugins/hvac-community-events/templates/page-*.php wp-content/themes/astra/hvac-community-events/ + +# List copied files +echo -e "\nCopied templates:" +ls -la wp-content/themes/astra/hvac-community-events/page-*.php + +# Clear cache +wp cache flush +wp breeze purge --cache=all + +echo -e "\n✅ Templates copied to theme directory" +ENDSSH \ No newline at end of file diff --git a/scripts/debug-template-loading.sh b/scripts/debug-template-loading.sh new file mode 100755 index 00000000..c6e7ca26 --- /dev/null +++ b/scripts/debug-template-loading.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +echo "=== Debugging Template Loading ===" + +ssh roodev@146.190.76.204 << 'ENDSSH' +cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html + +# Check registration page details +echo "Registration page details:" +wp post get 5334 --fields=ID,post_title,post_name,post_status,_wp_page_template + +# Check if the template file exists in plugin +echo -e "\nTemplate file in plugin:" +ls -la wp-content/plugins/hvac-community-events/templates/page-trainer-registration.php + +# Check if template is in theme +echo -e "\nChecking theme directories:" +ls -la wp-content/themes/astra/ | grep -i template +ls -la wp-content/themes/astra/page-*.php 2>/dev/null || echo "No page templates in theme root" + +# Check active plugins +echo -e "\nChecking if HVAC plugin is active:" +wp plugin list --status=active | grep hvac + +# Check if template include filter is working +echo -e "\nChecking hooks:" +wp eval 'global $wp_filter; if(isset($wp_filter["template_include"])) { echo "template_include filter exists with " . count($wp_filter["template_include"]) . " callbacks\n"; } else { echo "No template_include filter!\n"; }' + +ENDSSH \ No newline at end of file diff --git a/scripts/fix-page-templates.sh b/scripts/fix-page-templates.sh new file mode 100755 index 00000000..5c805f40 --- /dev/null +++ b/scripts/fix-page-templates.sh @@ -0,0 +1,116 @@ +#!/bin/bash + +echo "=== Fixing Page Templates ===" + +ssh roodev@146.190.76.204 << 'ENDSSH' +cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html + +# Find and assign templates for pages without them +echo "Finding pages that need templates..." + +# Certificate Reports +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Certificate Reports" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Certificate Reports (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-certificate-reports.php" +fi + +# Generate Certificates +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Generate Certificates" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Generate Certificates (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-generate-certificates.php" +fi + +# Email Attendees +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Email Attendees" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Email Attendees (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-email-attendees.php" +fi + +# Communication Templates +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Communication Templates" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Communication Templates (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-communication-templates.php" +fi + +# Communication Schedules +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Communication Schedules" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Communication Schedules (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-communication-schedules.php" +fi + +# Trainer Documentation +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Trainer Documentation" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Trainer Documentation (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-documentation.php" +fi + +# Event Summary +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Event Summary" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Event Summary (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-event-summary.php" +fi + +# Manage Event +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Manage Event" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Manage Event (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-manage-event.php" +fi + +# Certificate Fix (Master Trainer) +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Certificate System Diagnostics" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Certificate System Diagnostics (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-certificate-fix.php" +fi + +# Google Sheets Integration +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Google Sheets Integration" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Google Sheets Integration (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-google-sheets.php" +fi + +# Attendee Profile +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Attendee Profile" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Attendee Profile (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-attendee-profile.php" +fi + +# Account Status Pages +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Account Pending Approval" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Account Pending Approval (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-trainer-account-pending.php" +fi + +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Account Access Restricted" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Account Access Restricted (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-trainer-account-disabled.php" +fi + +page_id=$(wp post list --post_type=page --fields=ID,post_title --format=csv | grep "Registration Pending" | cut -d',' -f1) +if [ -n "$page_id" ]; then + echo "Assigning template to Registration Pending (ID: $page_id)" + wp post meta update "$page_id" "_wp_page_template" "page-registration-pending.php" +fi + +# Clear cache +wp cache flush +wp breeze purge --cache=all + +echo -e "\n✅ Templates assigned and cache cleared" + +# List all pages with their templates +echo -e "\n=== Current Page Templates ===" +wp db query "SELECT p.ID, p.post_title, p.post_name, pm.meta_value as template FROM wp_posts p LEFT JOIN wp_postmeta pm ON p.ID = pm.post_id AND pm.meta_key = '_wp_page_template' WHERE p.post_type='page' AND (p.post_title LIKE '%trainer%' OR p.post_title LIKE '%certificate%' OR p.post_title LIKE '%email%' OR p.post_title LIKE '%communication%' OR p.post_title LIKE '%event%' OR p.post_title LIKE '%profile%' OR p.post_title LIKE '%google%' OR p.post_title LIKE '%account%' OR p.post_title LIKE '%registration%') ORDER BY p.ID" +ENDSSH \ No newline at end of file diff --git a/templates/page-attendee-profile.php b/templates/page-attendee-profile.php new file mode 100644 index 00000000..b2fe7e6d --- /dev/null +++ b/templates/page-attendee-profile.php @@ -0,0 +1,12 @@ + +
+ +
+ +
+
+

Registration Pending

+

Thank you for registering! Your registration is currently pending approval.

+

You will receive an email notification once your account has been approved.

+

If you have any questions, please contact support at .

+

Return to Home

+
+
+ -// Render the registration shortcode -echo do_shortcode('[hvac_trainer_registration]'); +
+
+ +
+
+