---
phase: 05-mentor-job-board
plan: 03
type: execute
depends_on: []
files_modified: [includes/class-post-types.php]
---
Automatically crop uploaded job logos to 200x200px square for consistent display across archive and detail pages.
Purpose: Ensure all job logos display at consistent size regardless of upload dimensions, preventing layout issues in Elementor templates.
Output: WordPress image size registration that auto-generates 200x200px cropped version on upload.
~/.claude/get-shit-done/workflows/execute-plan.md
./summary.md
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
# Prior work this plan builds on:
@.planning/phases/01-foundation-setup/01-02-SUMMARY.md
@.planning/phases/01-foundation-setup/01-03-SUMMARY.md
# Source files:
@includes/class-post-types.php
@includes/class-acf-fields.php
**Tech stack available:** add_image_size() WordPress function, ACF image field with return_format='id'
**Established patterns:**
- ACF image field returns attachment ID (Phase 01-03: job_logo with return_format='id')
- Singleton pattern for post types class (Phase 01-02)
- Image sizes available via wp_get_attachment_image_src()
**Constraining decisions:**
- Phase 01-03: Logo field returns image ID, not URL, enabling access to all registered sizes
- Phase 01-03: Logo field optional (required=0) so not all jobs have logos
- PROJECT.md: Logo auto-crop to 200x200px for consistent display
- ROADMAP.md Phase 5: Logo upload and auto-crop to 200x200px
Task 1: Register 200x200px cropped image size for job logos
includes/class-post-types.php
Add static method register_image_sizes() to DDHH_JM_Post_Types class. Inside method, call add_image_size('job-logo', 200, 200, true) - width 200, height 200, hard crop true (ensures square crop from center). Hook method to after_setup_theme action (priority 10) - this is standard WordPress timing for image size registration. Register hook in existing init() method or create new setup_hooks() method following singleton pattern if init() doesn't exist. This ensures WordPress automatically generates 200x200px version when logos uploaded via ACF field. Elementor templates can then request this size via wp_get_attachment_image() or wp_get_attachment_image_src() using size 'job-logo'.
Check class-post-types.php contains register_image_sizes() method. Verify add_image_size called with parameters: 'job-logo', 200, 200, true. Confirm hook registered for after_setup_theme. Check method called from init() or setup_hooks().
Image size 'job-logo' registered with 200x200px hard crop, hook properly registered for after_setup_theme, method integrated into class initialization
Before declaring plan complete:
- [ ] Image size 'job-logo' registered via add_image_size()
- [ ] Dimensions are 200x200px with hard crop enabled
- [ ] Hook registered for after_setup_theme action
- [ ] Method properly called from class initialization
- WordPress image size 'job-logo' registered and available
- Uploaded logos auto-generate 200x200px cropped version
- Size accessible via standard WordPress image functions
- Elementor templates can use 'job-logo' size for consistent display
- Phase 5 complete - mentor job board fully functional