<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
我的一个 Wordpress 网站正在由不会停止在标题/标题末尾使用句号的人管理内容。我厌倦了手动追踪踪迹。
有没有办法让脚本阻止它们被渲染。类似于不渲染双空格的方式?
最佳答案
正如其他人所提到的,您可以挂接到 wordpress 页面标题,但您不能使用内容中的其他标题标签来执行此操作。您可以做的是编写一些 javascript。我在这里使用 jquery,它包含在 wordpress 中:
$('h1,h2,h3,h4,h5').each(function(){
var title = $(this).text();
if(title.slice(-1)=='.'){
$(this).text(title.slice(0, -1));
}
});
关于php - 我不能在网站标题/标题上呈现句号吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24954770/