MDx 文章底部版权信息

PHP代码

echo sprintf( "<p xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dct=\"http://purl.org/dc/terms/\" class=\"ah-copyright\"><a property=\"dct:title\" rel=\"cc:attributionURL\" href=\"%s\" class=\"ah-copyright-title\">%s</a>&nbsp;by&nbsp;<a rel=\"cc:attributionURL dct:creator\" property=\"cc:attributionName\" href=\"%s\" target=\"_self\" class=\"ah-copyright-author\">%s</a>&nbsp;is&nbsp;licensed&nbsp;under&nbsp;<a href=\"https://creativecommons.org/licenses/by-nc-sa/4.0/?ref=chooser-v1\" target=\"_blank\" rel=\"license noopener noreferrer\" class=\"ah-copyright-license\"><span>CC BY-NC-SA 4.0 International</span><img src=\"https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1\"><img src=\"https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1\"><img src=\"https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1\"><img src=\"https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1\"></a></p>", mdx_get_now_url( true, $post->ID ), get_the_title(), esc_url( get_the_author_meta( 'url' ) ), get_the_author() );

你需要将上述代码添加到 single.php 的如下位置

MDx single.php

需要注意的是,single.php 中有四处 mdui-card mdx-say-after ,我个人建议都进行替换

CSS代码

/**
 * @author AHdark
 * @license GPL-v3
 */

@icon-height: 18px;

p.ah-copyright {
  margin: 0;
}

.ah-copyright .ah-copyright-license {
  display:inline-flex;
  flex-direction: row;
  align-items: center;
}

.ah-copyright .ah-copyright-license img {
  height:@icon-height;
  margin-left:3px;
  vertical-align:text-bottom;
}

上述代码为Less格式,你可以编译后上传css至你的服务器并引用

css 代码你可以前往 https://cdn.ahdark.com/styles/creativecommons/creativecommons.min.css 获取

.mdx-footer-content{line-height:10px}.mdx-footer-copyright{display:flex;flex-direction:row;align-items:center;justify-content:space-between}@media screen and (max-width:700px){.mdx-footer-copyright{flex-direction:column}.mdx-footer-content{margin-top:12px;margin-left:0}}

而后在页头部分引用即可

<link rel="stylesheet" href="https://cdn.ahdark.com/styles/creativecommons/creativecommons.min.css" />

warning 警告
你需要将css文件地址替换为你自己的

MDx 文章底部版权信息 的发布基于协议 AHdark Blog License。如欲对此文章内容此文章转载、修改或行使任何超出预览和分享性质的行为,请参考此协议。
暂无评论

发送评论 编辑评论


|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇