'Original (full size)' ); $cfsp_registered = function_exists( 'wp_get_registered_image_subsizes' ) ? wp_get_registered_image_subsizes() : array(); foreach ( get_intermediate_image_sizes() as $cfsp_size ) { $cfsp_label = ucwords( str_replace( array( '-', '_' ), ' ', $cfsp_size ) ); if ( isset( $cfsp_registered[ $cfsp_size ] ) ) { $cfsp_dim = $cfsp_registered[ $cfsp_size ]; $cfsp_label .= sprintf( ' (%sx%s)', $cfsp_dim['width'] ? $cfsp_dim['width'] : 'auto', $cfsp_dim['height'] ? $cfsp_dim['height'] : 'auto' ); } $cfsp_sizes[ $cfsp_size ] = $cfsp_label; } CFSP_UI::card_start( 'Related posts at build time', 'Related posts are worked out while exporting and written into each post as plain links and images. Nothing loads from WordPress in the browser, and search engines can see them.' ); CFSP_UI::toggle( 'related_enabled', 'Build related posts into every post' ); if ( $cfsp_jetpack ) { CFSP_UI::notice( 'Jetpack Related Posts is active. On the static site it can\'t load its list, so Static Push fills Jetpack\'s own box instead. Its headline and styling stay exactly as they are now.', 'info', array( 'show_if' => 'related_enabled' ) ); } CFSP_UI::card_end(); /* ---------------------------------------------------------------- Matching */ CFSP_UI::card_start( 'Matching', 'How related posts are chosen.', array( 'show_if' => 'related_enabled' ) ); CFSP_UI::tags( 'related_post_types', 'Show on', CFSP_Settings::post_type_options(), array( 'help' => 'Content types that get a related posts box. Pages such as a privacy policy or contact page usually shouldn\'t, so only Posts are selected by default.' ) ); CFSP_UI::select( 'related_match', 'Match on', array( 'both' => 'Tags or categories (tags count more)', 'tags' => 'Tags only', 'categories' => 'Categories only', ), array( 'help' => 'Posts sharing more tags and categories rank higher; ties go to the newest post.' ) ); CFSP_UI::input( 'related_count', 'Posts to show', array( 'type' => 'number', 'min' => 1, 'max' => 12 ) ); CFSP_UI::select( 'related_fill', 'When fewer are found', array( 'latest' => 'Fill with the latest posts', 'none' => 'Show only the related posts found', ), array( 'help' => 'For posts that share a category or tag with only a few others (or with none). Related posts found by matching always come first; the latest posts fill the remaining places.' ) ); CFSP_UI::toggle( 'related_skip_default_cat', 'Ignore the default category', array( 'help' => 'Sharing "Uncategorized" (or whatever your default category is) doesn\'t make posts related.' ) ); CFSP_UI::input( 'related_refresh', 'Refresh neighbours on publish', array( 'type' => 'number', 'min' => 0, 'max' => 50, 'help' => 'When a post is published or edited, also re-export this many of its closest posts so their related lists include it. 0 turns this off; a weekly Scheduled rebuild (Automation) refreshes everything.', ) ); ?>

Paste a post address (WordPress or static) or a post ID to see which posts it would show. Uses the saved settings.

'related_enabled' ) ); ?>
array( 'Automatic', 'Jetpack\'s design when the page has a Jetpack Related Posts box, otherwise the simple grid.', 'admin-generic' ), 'jetpack' => array( 'Jetpack Related Posts', 'The exact markup and classes Jetpack uses, so its existing styles apply.', 'screenoptions' ), 'simple' => array( 'Simple grid', 'A clean responsive grid with its own small stylesheet, added after the post content.', 'grid-view' ), 'custom' => array( 'Custom template', 'Your own HTML, for matching a theme\'s related-posts section.', 'editor-code' ), ); foreach ( $cfsp_designs as $cfsp_key => $cfsp_d ) : ?>
'Shown above the related posts in every design. With the Jetpack design it replaces the heading in the Jetpack box; leave it empty to keep the heading Jetpack sets.' ) ); CFSP_UI::toggle( 'related_show_image', 'Show thumbnails' ); CFSP_UI::select( 'related_image_size', 'Image size', $cfsp_sizes, array( 'show_if' => 'related_show_image', 'help' => 'Original uses each post\'s featured image file as uploaded. If a smaller size doesn\'t exist for an image, the original is used with its real dimensions.', ) ); CFSP_UI::toggle( 'related_show_date', 'Show date' ); CFSP_UI::toggle( 'related_show_category', 'Show category', array( 'help' => 'Shown as In "News".' ) ); CFSP_UI::toggle( 'related_show_excerpt', 'Show a short excerpt' ); CFSP_UI::textarea( 'related_item_template', 'Item template', array( 'rows' => 4, 'show_if' => 'related_design=custom', 'placeholder' => '
  • {image}{title}
  • ', 'help' => 'Repeated for each post. Placeholders: {url} {title} {image} {image_url} {date} {category} {excerpt}', ) ); CFSP_UI::textarea( 'related_wrapper_template', 'Wrapper template', array( 'rows' => 3, 'show_if' => 'related_design=custom', 'placeholder' => '', 'help' => 'Placeholders: {headline} {items}. Added after the post content.', ) ); CFSP_UI::notice( 'Related posts are added when pages are exported. Run a Full site push after turning this on or changing the design. If a page cache serves stale pages to the exporter, clear it first.', 'tip' ); CFSP_UI::card_end();