英溯IT论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 9|回复: 1

newsberg模板添加多语言下拉框

[复制链接]

122

主题

156

帖子

735

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
735
发表于 3 天前 | 显示全部楼层 |阅读模式
/www/wwwroot/chamber.teochew.jp/wp-content/themes/newsup/inc/ansar/hooks
顶部加了多语言代码
<div class="mg-head-detail hidden-xs">
    <div class="container-fluid">
        <div class="row align-items-center">
            <div class="col-md-6 col-xs-12">
                <ul class="info-left">
                    <?php newsup_date_display_type(); ?>
                </ul>
            </div>

            <div class="col-md-6 col-xs-12">
                <ul class="mg-social info-right">
                    <?php if($header_social_icon_enable == true) { do_action('newsup_action_header_social_icon'); } ?>
                </ul>
                <div class="custom-lang-switcher-inline">
                  <?php
                    pll_the_languages(array(
                      'dropdown' => 0,
                      'show_flags' => 1,
                      'show_names' => 1,
                      'hide_if_empty' => 0,
                      'display_names_as' => 'name',
                    ));
                  ?>
                </div>
            </div>
        </div>
    </div>
</div>

红色为添加部分

回复

使用道具 举报

122

主题

156

帖子

735

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
735
 楼主| 发表于 前天 12:46 | 显示全部楼层
将这段 CSS 添加到外观 > 自定义 > 附加 CSS,或者主题的 style.css 文件中。

/* 语言切换器整体右对齐 */
.custom-lang-switcher-inline {
  text-align: right;
}

/* 每个语言项 */
.custom-lang-switcher-inline li {
  display: inline-block;
  margin-left: 8px;
}

/* 未选中语言按钮 */
.custom-lang-switcher-inline a {
  display: inline-block;
  color: #ffffff;
  background-color: #ff6f61;     /* 更鲜艳的浅红色 */
  padding: 4px 10px;
  height: 24px;
  line-height: 16px;
  border-radius: 5px;
  font-size: 13px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

/* 未选中语言按钮悬停 */
.custom-lang-switcher-inline a:hover {
  background-color: #ff3b2f;     /* 鲜红色,明显变深 */
  color: #ffffff;
}

/* 当前选中语言按钮 */
.custom-lang-switcher-inline .pll-current a {
  background-color: #8b0000;     /* 深暗红色,区别明显 */
  color: #ffffff;
  font-weight: bolder;
}

/* 国旗图标 */
.custom-lang-switcher-inline img {
  vertical-align: middle;
  margin-right: 4px;
  width: 16px;
  height: auto;
}


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|英溯IT论坛 ( 沪ICP备13022730号-6 )

GMT+8, 2025-7-1 22:18 , Processed in 0.100140 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表