These pages are connected to a custom template style that queries a custom post type
https://cotoacademy.com/about-yokohama-school/
https://cotoacademy.com/about-us/
Previously I tried cloning the About.php template that was selected in page attributes. My aim was to include a custom contact form for one school location.
Cloning the about.php and editing the title / file name didn't work and it seems to have broken my connection to the custom post type and their entries - so i tried reselecting the previous about template under page attributes which also didn't work.
Basically I
- Cloned my about.php template file
- renamed it - and edited the title of it within the php file
- Selected this new cloned php template
- this broke my connection to the custom post type and the selected template in page attributes
- I restored the original settings for the post prior to the issue
- this still hasn't fixed the problem
Any ideas on what happened? the template is below
<?php
/**
* Template Name: About
*
* @package WordPress
* @subpackage Coto Academy
*/
?> <?php get_header(); ?>
<section class="section__container">
<div class="section__container">
<div class="section__content"> <?php the_content(); ?>
</div>
</section>
<section class="staffs">
<div class="anchor-point" id="our-school-staff"></div>
<div class="container">
<h2 class="staff__title">Our school Staff</h2>
<div class="desktop" style="height:40px;"></div>
<div class="mobile" style="height:20px;"></div>
<?php
$schools = get_field('select_school');
foreach ($schools as $school):
$loop = new WP_Query(array(
'post_type' => 'staff',
'posts_per_page' => 99,
'meta_query' => array(
array(
'key' => 'select_school',
'value' => $school,
'compare' => 'LIKE'
),
array(
'key' => 'teacher_or_staff',
'value' => 'staff',
'compare' => 'LIKE'
)
)
));
endforeach;
?>
<?php $the_count = $loop->found_posts; ?>
<ul class="staff-list flex-wrap">
<?php
while ($loop->have_posts()):
$loop->the_post(); ?>
<?php get_template_part('staffs/staff'); ?>
<?php
endwhile;
wp_reset_query();
?>
</div>
<div class="desktop" style="height:40px;"></div>
<div class="mobile" style="height:20px;"></div>
</section>
<section class="staffs">
<div class="anchor-point" id="our-teachers"></div>
<div class="container">
<h2 class="staff__title">Our teachers</h2>
<div class="desktop" style="height:40px;"></div>
<div class="mobile" style="height:20px;"></div>
<?php
$schools = get_field('select_school');
foreach ($schools as $school):
$loop = new WP_Query(array(
'post_type' => 'staff',
'posts_per_page' => 99,
'meta_query' => array(
array(
'key' => 'select_school',
'value' => $school,
'compare' => 'LIKE'
),
array(
'key' => 'teacher_or_staff',
'value' => 'teacher',
'compare' => 'LIKE'
)
)
));
endforeach;
?>
<?php $the_count = $loop->found_posts; ?>
<ul class="staff-list flex-wrap">
<?php
while ($loop->have_posts()):
$loop->the_post(); ?>
<?php get_template_part('staffs/staff'); ?>
<?php
endwhile;
wp_reset_query();
?>
</div>
<div class="desktop" style="height:40px;"></div>
<div class="mobile" style="height:20px;"></div>
</section>
<?php get_footer();
Any ideas?
question from:
https://stackoverflow.com/questions/65932611/i-tried-changing-my-wordpress-template-in-page-attributes-now-its-broken 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…