wordpress once主题修改 代码块 序号旁添加竖线

2024-05-26 237 0

此主题已添加序号,但没有序号旁没有竖线

# cat /wordpress_web_path/wp-content/themes/once/single.php

<?php if (get_theme_mod('ds_highlight')) { ?>
<script src="<?php bloginfo('template_directory'); ?>/assets/highlight/highlight.min.js"></script>
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/assets/highlight/atom-one-light.css">
<script src="<?php bloginfo('template_directory'); ?>/assets/highlight/highlightjs-line-numbers.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
$(document).ready(function() {
    $('.wznrys pre code').each(function(i, block) {
        hljs.lineNumbersBlock(block);
    });
});
</script>
<?php } ?>
# vim /wordpress_web_path/wp-content/themes/once/assets/highlight/atom-one-light.css

.hljs-ln-numbers {
    .hljs-ln-numbers {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    text-align: center;
    color: #ccc;
    border-right: 1px solid #CCC;
    vertical-align: top;
    padding-right: 5px;
}
.hljs-ln-line.hljs-ln-code {
    padding-left: 10px !important;
}

https://www.eddymens.com/blog/highlightjs-add-line-numbers

相关文章

wordpress once主题 搜索页无内容调整

发布评论