✔ Teachers archive page needs to be consistent (~10 items)
Completed by Kyle S.
- Assigned to
-
Kyle S.
- Notes
-
- Not all teachers are showing. Why? (There are 32)
- If no image, show https://school.agatha.diocesanweb.org/wp-content/uploads/sites/3/2019/04/ministries_placeholder-300x201.png
- All images should be the same height
- Teachers page should also show link/button to view their class
- Teachers should display category sections
- The content container should match the rest of the site
- Archive page title should just say "Our Staff" because it will be teacher plus some office staff
- Display title, phone & email below name
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 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>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; ?>