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>
This commit is contained in:
1 parent
4c562428b4
commit
f53cdd4dc8
7 files changed
+328
-402
No files matched your search
@@ -8,63 +8,87 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
get_header();
|
||||
|
||||
$post_id = (int) get_queried_object_id();
|
||||
$settings = function_exists('jio_get_page_links_settings') ? jio_get_page_links_settings($post_id) : [];
|
||||
$links_html = function_exists('jio_page_links_html') ? jio_page_links_html($post_id) : '';
|
||||
$search_html = function_exists('jio_link_get_search_cover') ? jio_link_get_search_cover($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 page-content-default',
|
||||
'has_sidebar' => false,
|
||||
'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
|
||||
get_template_part('templates/parts/page-header', null, [
|
||||
'title' => esc_html__('友情链接', 'jio'),
|
||||
'desc' => __('与这些优秀的站点交换友链', 'jio'),
|
||||
]);
|
||||
echo $search_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper returns escaped markup.
|
||||
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 (!empty($settings['content_s']) && ($settings['content_position'] ?? 'top') === 'top') {
|
||||
echo '<div class="zib-widget mb20"><article class="article content-main__body">';
|
||||
the_content();
|
||||
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.
|
||||
}
|
||||
|
||||
echo $links_html; // 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 (!empty($settings['content_s']) && ($settings['content_position'] ?? 'top') !== 'top') {
|
||||
echo '<div class="zib-widget mb20"><article class="article content-main__body">';
|
||||
the_content();
|
||||
echo '</article></div>';
|
||||
}
|
||||
|
||||
if (!empty($settings['submit_s']) && !empty($settings['submit_title'])) {
|
||||
printf(
|
||||
'<p class="text-center" style="margin-top:24px;"><a class="padding-h10 hollow but c-theme btn-block" href="#submit-links-modal" data-toggle="modal">%s</a></p>',
|
||||
esc_html((string) $settings['submit_title'])
|
||||
);
|
||||
}
|
||||
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'] ?? ''),
|
||||
'sign' => !empty($settings['submit_sign_s']),
|
||||
'cats' => (array) ($settings['submit_cats'] ?? []),
|
||||
'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' => false]);
|
||||
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();
|
||||
Reference in new issue
Block a user