Agatha - Miami, FL

Teachers archive page needs to be consistent (~10 items)

Assigned to
Kyle Sullivan, Web Development at Diocesan Kyle S.
Notes

Comments & Events

Kyle Sullivan, Web Development at Diocesan
I've finished this task (at least unless/until they ask to sort teachers by category). Here are some comments.

As to the point about the cap at 10 teachers, WordPress's settings can be updated in Settings > Reading under the field for Blog pages show at most or in functions.php. Because this is a multi-site, I chose the latter approach and fixed this with the following code.
/**
 * Set posts_per_page to 1000
 */
function posts_per_page($query){
  if ($query->is_main_query() && $query->is_archive){
    $query->set( 'posts_per_page', 1000);
  }
  return $query;
}
add_action('pre_get_posts','posts_per_page');
As the point about the default teacher image, this is set in an ACF Field under Theme Settings on the School page of the multi-site. I would recommend a less gendered default image, but I'll let them choose what they'd like for this.

As the the point about homogenizing image height, this has been done, and I believe the solution I crafted in sass/site/secondary/_archive.scss works well across different devices, but I'll do more work with finalizing responsive design after they've had their training.

As to the point about linking to the teachers' respective class pages, unfortunately, the relationship I set up isn't inherently bilateral/reciprocal, so this isn't an option without more theme customization and/or additional data on the content side of this site.

As I've mentioned supra, I haven't done anything with the teachers' respective categories (whether sorting by them or merely displaying them [whether on the archive or on the teachers' respective pages]), but if they'd like more done with this, this should be attainable without too much trouble (as this would just pull in the corresponding custom taxonomy).

I've changed the class of the container for archives from .limit-width to .limit-width-sm, which is what the rest of this site uses for the narrower container desired here.

As to the point about updating the Archive title for teachers, this was accomplished with the following code in archive.php.
<div class="pageHeaderTitle">
  <?php if ( is_post_type_archive('teachers') ) echo "Our Staff";
  else the_archive_title(); ?>
</div>
And as to the last point about adding teachers' respective title, phone number and email address, I've done this and have made links from the same with the following code in archive.php.
if(is_post_type_archive('teachers')) : ?>
  <a href="<?= get_permalink(); ?>" class="title"><?= get_field('title'); ?></a>
  <a href="<?= phone_link(get_field('phone')); ?>" class="phone"><?= get_field('phone'); ?></a>
  <a href="mailto:<?= get_field('email'); ?>" class="email"><?= get_field('email'); ?></a>
  <!-- <a href="<?= the_permalink(); ?>" class="excerpt-more">Teacher Information</a> -->
<?php else : ?>
  <a href="<?= the_permalink(); ?>" class="excerpt-more">Read More</a>
<?php endif; ?>
Please reopen this task with specific directions if anything further needs to be done.
Kyle Sullivan, Web Development at Diocesan
Kyle Sullivan completed this to-do.