Files
kate522andClaude Opus 5 f53cdd4dc8 feat(links): align the friends page layout and submit UI
- assemble the friends template with page header, search cover, content position, widget zones and comments
- render the three page title styles and the tabbed search cover
- restore card, category nav and submit modal markup for the friends page
- add page content style support to the page editor
- port the linked card, category nav and submit modal styles to the mobile and desktop breakpoints

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-05 21:09:40 +08:00

95 lines
3.5 KiB
PHP

<?php
/**
* Template Name: 友情链接
* Template Post Type: page
*
* @package Jio
*/
defined('ABSPATH') || exit;
$post_id = (int) get_queried_object_id();
$settings = function_exists('jio_get_page_links_settings') ? jio_get_page_links_settings($post_id) : [];
$has_sidebar = function_exists('jio_is_show_sidebar') ? jio_is_show_sidebar() : false;
$content_style = sanitize_key((string) get_post_meta($post_id, 'page_content_style', true));
if (!in_array($content_style, ['', 'not', 'nobox', 'full'], true)) {
$content_style = '';
}
$content_style_class = $content_style !== '' ? ' page-content-' . $content_style : ' page-content-default';
get_header();
if (is_active_sidebar('page_top_fluid_' . $post_id)) {
echo '<div class="fluid-widget-wrap">';
dynamic_sidebar('page_top_fluid_' . $post_id);
echo '</div>';
}
if (function_exists('jio_archive_open_shell')) {
jio_archive_open_shell([
'main_class' => 'site-main container' . $content_style_class,
'has_sidebar' => $has_sidebar,
'page_kind' => 'friends',
]);
}
?>
<div class="content-main content-main--page content-main--friends">
<?php if (is_active_sidebar('page_top_content_' . $post_id)) : ?>
<?php dynamic_sidebar('page_top_content_' . $post_id); ?>
<?php endif; ?>
<?php
while (have_posts()) :
the_post();
echo function_exists('jio_links_page_header') ? jio_links_page_header($post_id) : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper returns escaped markup.
echo function_exists('jio_link_get_search_cover') ? jio_link_get_search_cover($post_id) : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper returns escaped markup.
if (($settings['content_position'] ?? 'top') !== 'top') {
echo function_exists('jio_page_links_html') ? jio_page_links_html($post_id) : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper returns escaped markup.
}
if (!empty($settings['content_s']) && $content_style !== 'not') {
echo '<div class="jio-panel"><article class="article wp-posts-content">';
the_content();
wp_link_pages([
'before' => '<p class="text-center post-nav-links radius8 padding-6">',
'after' => '</p>',
]);
echo '</article></div>';
}
if (($settings['content_position'] ?? 'top') === 'top') {
echo function_exists('jio_page_links_html') ? jio_page_links_html($post_id) : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper returns escaped markup.
}
endwhile;
?>
<?php if (is_active_sidebar('page_bottom_content_' . $post_id)) : ?>
<?php dynamic_sidebar('page_bottom_content_' . $post_id); ?>
<?php endif; ?>
<?php comments_template(); ?>
</div>
<?php
if (!empty($settings['submit_s'])) {
echo jio_submit_links_modal([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper returns escaped markup.
'title' => (string) ($settings['submit_title'] ?? ''),
'dec' => (string) ($settings['submit_dec'] ?? ''),
'show_title' => true,
'sign' => !empty($settings['submit_sign_s']),
'cats' => (array) ($settings['submit_cats'] ?? []),
], $post_id);
}
if (function_exists('jio_archive_close_shell')) {
jio_archive_close_shell(['has_sidebar' => $has_sidebar]);
}
if (is_active_sidebar('page_bottom_fluid_' . $post_id)) {
echo '<div class="fluid-widget-wrap">';
dynamic_sidebar('page_bottom_fluid_' . $post_id);
echo '</div>';
}
get_footer();