Compare commits
2 Commits
8e977dc75d
...
d860a34680
| Author | SHA1 | Date | |
|---|---|---|---|
| d860a34680 | |||
| b324384bb5 |
@@ -30,6 +30,17 @@
|
||||
margin-bottom: 0.5rem; /* 增加行间距 */
|
||||
}
|
||||
|
||||
.footer-links-columns {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 0 1.5rem;
|
||||
}
|
||||
|
||||
.footer-links {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.footer-links a {
|
||||
color: var(--text-secondary);
|
||||
font-size: 14px; /* 增大链接字号 (原0.9rem/14.4px) */
|
||||
@@ -57,6 +68,10 @@
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.footer-links-columns {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
grid-template-columns: 1fr; /* 手机 1列 */
|
||||
}
|
||||
|
||||
@@ -4,25 +4,40 @@
|
||||
<div class="footer-content">
|
||||
<div class="footer-section">
|
||||
<h3 data-cn="友情链接" data-en="Links"></h3>
|
||||
<ul class="footer-links">
|
||||
<?php foreach ((array) ($site_content['footer_links'] ?? array()) as $link) : ?>
|
||||
<?php
|
||||
$url = esc_url((string) ($link['url'] ?? ''));
|
||||
$title_cn = trim((string) ($link['title_cn'] ?? ''));
|
||||
$title_en = trim((string) ($link['title_en'] ?? ''));
|
||||
if ($url === '' || ($title_cn === '' && $title_en === '')) {
|
||||
continue;
|
||||
}
|
||||
if ($title_cn === '') {
|
||||
$title_cn = $title_en;
|
||||
}
|
||||
if ($title_en === '') {
|
||||
$title_en = $title_cn;
|
||||
}
|
||||
?>
|
||||
<li><a href="<?php echo $url; ?>" target="_blank" rel="noopener noreferrer" data-cn="<?php echo esc_attr($title_cn); ?>" data-en="<?php echo esc_attr($title_en); ?>"></a></li>
|
||||
<?php
|
||||
$footer_link_items = array();
|
||||
foreach (array_slice((array) ($site_content['footer_links'] ?? array()), 0, 8) as $link) {
|
||||
if (!is_array($link)) {
|
||||
continue;
|
||||
}
|
||||
$url = esc_url((string) ($link['url'] ?? ''));
|
||||
$title_cn = trim((string) ($link['title_cn'] ?? ''));
|
||||
$title_en = trim((string) ($link['title_en'] ?? ''));
|
||||
if ($url === '' || ($title_cn === '' && $title_en === '')) {
|
||||
continue;
|
||||
}
|
||||
if ($title_cn === '') {
|
||||
$title_cn = $title_en;
|
||||
}
|
||||
if ($title_en === '') {
|
||||
$title_en = $title_cn;
|
||||
}
|
||||
$footer_link_items[] = array(
|
||||
'url' => $url,
|
||||
'title_cn' => $title_cn,
|
||||
'title_en' => $title_en,
|
||||
);
|
||||
}
|
||||
?>
|
||||
<div class="footer-links-columns">
|
||||
<?php foreach (array_chunk($footer_link_items, 4) as $footer_link_column) : ?>
|
||||
<ul class="footer-links">
|
||||
<?php foreach ($footer_link_column as $link) : ?>
|
||||
<li><a href="<?php echo $link['url']; ?>" target="_blank" rel="noopener noreferrer" data-cn="<?php echo esc_attr($link['title_cn']); ?>" data-en="<?php echo esc_attr($link['title_en']); ?>"></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer-section">
|
||||
|
||||
Reference in New Issue
Block a user