测试代码高亮:
<head>
<meta charset="<?php echo get_bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="<?php echo get_template_directory_uri() ?>/css/bootstrap.min.css?v=20240515">
<link rel="stylesheet" href="<?php echo get_template_directory_uri() ?>/style.css?v=20240914">
<link href="<?php echo get_template_directory_uri() ?>/fontawesome/css/all.min.css" rel="stylesheet">
<title><?php
$site_name = get_bloginfo('name');
$site_description = get_bloginfo('description');
$page_title = wp_title('', false);
if (is_front_page() || is_home()) {
echo $site_name . ' – ' . $site_description;
} elseif (is_search()) {
echo '「' . get_search_query() . '」的搜索结果 – ' . $site_name;
} else {
echo $page_title . ' – ' . $site_name;
}
?></title>
<?php wp_head(); ?>
<script src="<?php echo get_template_directory_uri() ?>/js/jquery-1.10.2.min.js"></script>
<script src="<?php echo get_template_directory_uri() ?>/js/bootstrap.bundle.min.js?v=20240515"></script>
<script src="<?php echo get_template_directory_uri() ?>/highlight/highlight.min.js"></script>
<link rel="stylesheet" href="<?php echo get_template_directory_uri() ?>/highlight/styles/atom-one-dark.min.css" />
<!-- <link rel="stylesheet" href="https://npm.elemecdn.com/[email protected]/style.css" /> -->
<?php if ( is_admin_bar_showing() ) { ?>
<style>
.my-navbar {
top: 32px;
}
</style>
<?php } ?>
</head>
<header class="sticky-top my-navbar">
<nav class="navbar navbar-expand-lg bg-body-tertiary" >
<div class="container">
<a class="navbar-brand" href="<?php echo home_url() ?>"><?php echo get_bloginfo('name');?></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<?php
wp_nav_menu(array(
'theme_location' => 'mainmenu',
'depth' => 2, // 1 = no dropdowns, 2 = with dropdowns.
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'navbarNav',
'menu_class' => 'navbar-nav mr-auto',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker(),
))
?>
<?php /*
<form class="d-flex" role="search" method="get" action="<?php echo home_url( '/' ); ?>">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search" value="<?php echo get_search_query(); ?>" name="s">
<button class="btn btn-outline-secondary" type="submit">Search</button>
</form>
*/ ?>
</div>
</nav>
</header>
/// <summary>
/// 将传入的字符串中间部分字符替换成特殊字符
/// </summary>
/// <param name="value">需要替换的字符串</param>
/// <param name="startLen">前保留长度</param>
/// <param name="endLen">尾保留长度</param>
/// <param name="replaceChar">特殊字符</param>
/// <returns>被特殊字符替换的字符串</returns>
private string ReplaceWithSpecialChar(string value, int startLen = 4, int endLen = 6, char specialChar = '*')
{
if (string.IsNullOrEmpty(value))
{
return "";
}
try
{
int lenth = value.Length - startLen - endLen;
string replaceStr = value.Substring(startLen, lenth);
string specialStr = string.Empty;
for (int i = 0; i < replaceStr.Length; i++)
{
specialStr += specialChar;
}
value = value.Replace(replaceStr, specialStr);
}
catch (Exception)
{
throw;
}
return value;
}
标签:string,min,int,value,js,test,css From: https://www.cnblogs.com/art/p/18449574