diff --git a/author.php b/author.php index b8fc50d..74f5e36 100644 --- a/author.php +++ b/author.php @@ -61,7 +61,7 @@ $author_query = new WP_Query(array( - + diff --git a/functions.php b/functions.php index 8563f9e..fcf6fca 100644 --- a/functions.php +++ b/functions.php @@ -141,11 +141,19 @@ add_action('template_include', function($template) { -// 禁用 Gravatar — 本地默认头像 +// 本地头像(团队证件照) add_filter('get_avatar', function($avatar, $id_or_email, $size, $default, $alt) { - // 用 data URI 的默认灰色圆圈替代 - $svg = ''; - return '' . $svg . ''; + $uid = 0; + if (is_numeric($id_or_email)) $uid = (int) $id_or_email; + elseif (is_object($id_or_email) && isset($id_or_email->user_id)) $uid = (int) $id_or_email->user_id; + $att_id = get_user_meta($uid, 'custom_avatar', true); + if ($att_id) { + $url = wp_get_attachment_image_url($att_id, 'medium'); + if ($url) { + return ''; + } + } + return $avatar; // fallback }, 10, 5); // 激活主题时自动初始化 diff --git a/page-articles.php b/page-articles.php index b6ac18d..8b98d5f 100644 --- a/page-articles.php +++ b/page-articles.php @@ -5,7 +5,7 @@ get_header(); $pg = isset($_GET['pg']) ? max(1, (int) $_GET['pg']) : 1; -$per_page = 3; +$per_page = 20; $query = new WP_Query(array( 'post_type' => 'post', 'posts_per_page' => $per_page, @@ -23,6 +23,11 @@ $total_pages = ceil($total / $per_page);
have_posts()) : $query->the_post(); ?> + +
+ get_the_title())); ?> +
+
'article-avatar')); ?> diff --git a/style.css b/style.css index 8dfc31f..8ba7be1 100644 --- a/style.css +++ b/style.css @@ -301,3 +301,67 @@ echo "done" .article-cover { overflow: hidden; height: 240px; } /* Thumbnail fix — regenerate without black bars */ + +.article-item__thumb { + width: 60px; + height: 60px; + border-radius: var(--radius); + overflow: hidden; + flex-shrink: 0; + margin-right: 16px; +} +.article-item__thumb img { + width: 100%; + height: 100%; + object-fit: cover; +} +.article-item { + display: flex; + align-items: center; +} + +.avatar, .pinned-avatar, .card-avatar, .tucao-avatar, .article-avatar, .avatar-sm { + object-fit: cover !important; + border-radius: 50% !important; +} + +.avatar, .pinned-avatar, .card-avatar, .tucao-avatar, .article-avatar, .avatar-sm { + object-position: center 20%; +} + +.avatar-16, .card-avatar, .tucao-avatar, .article-avatar { + width: 16px !important; + height: 16px !important; +} +.avatar-18, .pinned-avatar { + width: 18px !important; + height: 18px !important; +} +.avatar-14, .article-avatar { + width: 14px !important; + height: 14px !important; +} +.avatar-sm { + width: 16px !important; + height: 16px !important; +} + +.single-post__meta img, +.article-byline img { + width: 22px !important; + height: 22px !important; + border-radius: 50% !important; + object-fit: cover !important; + vertical-align: middle; +} +.article-byline span { + display: inline-flex; + align-items: center; + gap: 6px; +} +.author-card__avatar { + width: 56px !important; + height: 56px !important; + border-radius: 50% !important; + object-fit: cover !important; +}