| Server IP : 112.74.42.100 / Your IP : 216.73.216.142 Web Server : nginx/1.20.2 System : Linux iZwz96lx4pjqiy84w4hni7Z 5.10.134-17.3.al8.x86_64 #1 SMP Thu Oct 31 14:29:57 CST 2024 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/sanxuany.cn/wp-content/themes/onenav/ |
Upload File : |
<?php
/*
* @Theme Name:One Nav
* @Theme URI:https://www.iotheme.cn/
* @Author: iowen
* @Author URI: https://www.iowen.cn/
* @Date: 2021-03-01 10:19:07
* @LastEditors: iowen
* @LastEditTime: 2025-04-25 14:55:40
* @FilePath: /onenav/search.php
* @Description:
*/
if ( ! defined( 'ABSPATH' ) ) { exit; }
$type = esc_attr(get_query_var('post_type'));
io_set_history_search($s, $type);
switch ($type) {
case 'app':
$_class = 'row-col-2a row-col-md-3a row-col-lg-4a';
break;
case 'book':
$_class = 'row-col-2a row-col-md-3a row-col-lg-4a';
break;
case 'post':
$_class = 'row-col-2a row-col-md-3a row-col-lg-4a';
break;
default:
$_class = 'row-col-1a row-col-md-2a row-col-lg-4a';
break;
}
get_header();
?>
<div id="content" class="container mb-4 mb-md-5">
<?php echo io_search_body_html() ?>
<main class="content" role="main">
<div class="content-wrap">
<div class="content-layout">
<div class="mb-4">
<?php
$search_page = io_get_search_types();
if(count($search_page)>1){
foreach($search_page as $v){
echo '<a class="btn btn-tab-h mr-2 text-gray ' . ($post_type == $v ? 'active' : '') . '" href="' . esc_url(home_url() . '?s=' . htmlspecialchars($s) . '&post_type=' . $v) . '" title="' . sprintf(__('有关“%s”的%s', 'i_theme'), htmlspecialchars($s), io_get_search_type_name($v)) . '">' . io_get_search_type_name($v) . '</a>';
}}
?>
</div>
<h4 class="text-gray text-lg mb-4"><i class="iconfont icon-search mr-1"></i><?php echo sprintf( __('“%s”的搜索结果', 'i_theme'), htmlspecialchars($s) ) ?></h4>
<div class="posts-row <?php echo $_class ?>">
<?php
if (!have_posts()) {
echo get_none_html();
}
if ( have_posts() ) :
while ( have_posts() ) : the_post();
switch ($type) {
case 'app':
echo get_app_card('max');
break;
case 'book':
echo get_book_card(io_get_book_card_mode());
break;
case 'post':
echo get_post_card('card');
break;
default:
echo get_sites_card('max');
break;
}
endwhile;
endif;
?>
</div>
<div class="posts-nav mb-4">
<?php echo paginate_links(array(
'prev_next' => 0,
'before_page_number' => '',
'mid_size' => 2,
));?>
</div>
</div>
</div>
<?php get_sidebar(); ?>
</main>
</div>
<?php
get_footer();