Add WP bookmarks-based navigation page with multi-category sticky nav, search-engine cover, front submit modal/AJAX, page meta, and styles.
83 lines
2.5 KiB
PHP
83 lines
2.5 KiB
PHP
<?php
|
|
/**
|
|
* Template Name: AKSRT - 网址导航
|
|
* Template Post Type: page
|
|
*
|
|
* Zibll pages/links.php 1:1 — multi-category bookmarks, search cover, submit modal.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$post_id = (int) get_queried_object_id();
|
|
$s = function_exists('aksrt_get_page_links_settings')
|
|
? aksrt_get_page_links_settings($post_id)
|
|
: [];
|
|
|
|
get_header();
|
|
?>
|
|
<main class="container page-content-default page-template-links">
|
|
<div class="content-wrap">
|
|
<div class="content-layout">
|
|
<?php
|
|
while (have_posts()) :
|
|
the_post();
|
|
|
|
// Optional page header (style 1 / 2 / 3 via existing page meta).
|
|
if (function_exists('aksrt_get_page_header_html')) {
|
|
echo aksrt_get_page_header_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
} else {
|
|
$header_style = (string) get_post_meta($post_id, 'page_header_style', true);
|
|
if ($header_style !== 'not') {
|
|
echo '<div class="theme-box radius8 main-bg main-shadow box-body mb20"><h1 class="article-title">' . esc_html(get_the_title()) . '</h1></div>';
|
|
}
|
|
}
|
|
|
|
if (function_exists('aksrt_link_get_search_cover')) {
|
|
echo aksrt_link_get_search_cover($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
}
|
|
|
|
$links_html = function_exists('aksrt_page_links_html') ? aksrt_page_links_html($post_id) : '';
|
|
$content_s = !empty($s['content_s']);
|
|
$position = (string) ($s['content_position'] ?? 'top');
|
|
|
|
if ($position !== 'top') {
|
|
echo $links_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
}
|
|
|
|
if ($content_s) {
|
|
echo '<div class="zib-widget"><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 ($position === 'top') {
|
|
echo $links_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
}
|
|
endwhile;
|
|
|
|
if (comments_open() || get_comments_number()) {
|
|
comments_template();
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<?php get_sidebar(); ?>
|
|
</main>
|
|
<?php
|
|
if (!empty($s['submit_s']) && function_exists('aksrt_submit_links_modal')) {
|
|
echo aksrt_submit_links_modal([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
'title' => (string) ($s['submit_title'] ?? __('申请入驻', 'aksrt')),
|
|
'dec' => (string) ($s['submit_dec'] ?? ''),
|
|
'sign' => !empty($s['submit_sign_s']),
|
|
'cats' => (array) ($s['submit_cats'] ?? []),
|
|
]);
|
|
}
|
|
|
|
get_footer();
|