How the homepage CPT, theme block, and RSS feed serve the front page.
Front-page render path
The block theme front-page template contains prc-platform/latest-homepage. On the frontend, the block render_callback queries the most recent published homepage post (orderby=date DESC, posts_per_page=1), runs post_content through the_content, and returns the HTML. Settings → Reading does not need a static front page for this flow.
In the editor, the block loads the latest (or preview-selected) homepage via useEntityRecords and renders it with InnerBlocksAsSyncedContent so the layout is editable in place.
Homepage serving
Permalink and admin bar
get_permalink() for a homepage post returns the singular /homepage/{slug}/ URL. Content_Type::modify_homepage_permalink() is hooked to post_link, which WordPress only runs for the post type, so that filter does not rewrite homepage permalinks. Leave it off post_type_link. Featured-image capture screenshots the singular URL, not home_url().
On the front page, admin_bar_menu replaces the default Edit Page node with Edit Homepage pointing at the latest published homepage.
Featured image screenshot
Content_Type opts homepage into prc_platform_post_publish_pipeline_post_types. includes/class-featured-image-capture.php listens on prc_platform_async_on_publish and prc_platform_async_on_update, matching print-engine PDF export. When the post type is homepage and the status is publish, it enqueues Action Scheduler hook prc_homepages_capture_featured_image unless a job is already pending or the content hash matches.
The job POSTs to Firebase screenshotElement with viewportWidth / viewportHeight 1200, waits for .wp-block-post-content, sideloads the PNG, and calls set_post_thumbnail. It deletes only the previous _homepage_screenshot_attachment_id. The CPT supports thumbnail so All Homepages can read featuredImage.
The pipeline does not fire from WP-CLI. Scheduled homepage publishes that run only through CLI cron will not capture until the next editor save on that published post.
Homepage screenshot capture
RSS feed /feed/homepage
includes/class-feed.php registers add_feed( 'homepage', ... ). The feed walks prc-block/story-item blocks in the latest homepage and emits RSS for those story post IDs.
| Transient | Contents | TTL |
|---|---|---|
prc_homepage_feed_content | Rendered RSS XML | 1 hour |
prc_homepage_story_ids | Story post ID array | 1 hour |
Both clear on save_post_homepage.
Helpers
includes/utils.php exposes get_latest_homepage_id(), get_latest_homepage_title(), and get_latest_homepage_permalink().
Default template
Content_Type::get_template() (PHP) and DEFAULT_CONTENT in src/constants.js seed a 3-column prc-block/grid-controller with five prc-block/story-item blocks when creating a homepage from admin or the create modal.