导入 AKSRT 主题开发源码
This commit is contained in:
1 parent
9681dd3d48
commit
1268a55dd0
595 files changed
+127705
No files matched your search
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Home Module · Friend Links
|
||||
*
|
||||
* config: { title? }
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$cfg = get_query_var('aksrt_module_config', []);
|
||||
if (!is_array($cfg)) $cfg = [];
|
||||
|
||||
$title = (string) ($cfg['title'] ?? '');
|
||||
|
||||
$friend_links = aksrt_get_friend_links();
|
||||
if (!is_array($friend_links) || empty($friend_links)) return;
|
||||
if (empty($friend_links)) return;
|
||||
?>
|
||||
|
||||
<section class="home-module home-module--friends container" aria-label="<?php echo esc_attr($title ?: __('友情链接', 'aksrt')); ?>">
|
||||
<header class="home-module__header">
|
||||
<h2 class="home-module__title"><?php echo esc_html($title ?: __('友情链接', 'aksrt')); ?></h2>
|
||||
</header>
|
||||
|
||||
<ul class="home-module__friends-list">
|
||||
<?php foreach ($friend_links as $link) :
|
||||
$url = $link['url'] ?? '';
|
||||
$name = $link['name'] ?? '';
|
||||
$description = $link['description'] ?? '';
|
||||
$logo = $link['logo'] ?? '';
|
||||
if (!$url || !$name) continue;
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo esc_url($url); ?>" target="_blank" rel="noopener noreferrer external" class="home-module__friend-card">
|
||||
<?php if ($logo) : ?>
|
||||
<img src="<?php echo esc_url($logo); ?>" alt="" class="home-module__friend-avatar"<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
|
||||
<?php endif; ?>
|
||||
<div class="home-module__friend-meta">
|
||||
<strong><?php echo esc_html($name); ?></strong>
|
||||
<?php if ($description) : ?>
|
||||
<span><?php echo esc_html($description); ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</section>
|
||||
Reference in new issue
Block a user