Php 不需要的<;a>;Wordpress中的标签
我对WordPress创建代码的方式有问题 如下图所示,我的文章应该包装在Php 不需要的<;a>;Wordpress中的标签,php,wordpress,anchor,Php,Wordpress,Anchor,我对WordPress创建代码的方式有问题 如下图所示,我的文章应该包装在 应导致以下情况: <article class="post-thumb"> <a href="#"> <img src="3a.jpg" id="image"> <div class="post-thumb-caption"> <h2>Titel</h2>
应导致以下情况:
<article class="post-thumb">
<a href="#">
<img src="3a.jpg" id="image">
<div class="post-thumb-caption">
<h2>Titel</h2>
</div>
<div class="post-thumb-caption-hover">
<div class="post-thumb-caption-hover-center">
<img id="menu-icon" class="icons svg" src="icons/menu21.svg">
<h2>Titel</h2>
<h3>Categorie</h3>
</div>
</div>
</a>
</article>
但是WordPress创造了这个:
<article class="post-thumb">
<a href="http://localhost/sm/titel/">
<img width="300" height="300" src="http://localhost/sm/wp-content/uploads/2014/08/3a.jpg" class="attachment-post-thumbnail wp-post-image" alt="3a"> <div class="post-thumb-caption">
<h2>Titel</h2>
</div>
</a><div class="post-thumb-caption-hover"><a href="http://localhost/sm/Titel/">
</a><div class="post-thumb-caption-hover-center"><a href="http://localhost/sm/Titel/">
<img id="menu-icon" class="icons svg" src="icons/menu21.svg">
<h2>Willem en Henk</h2>
</a><h3><a href="http://localhost/sm/Titel/"></a><a href="http://localhost/sm/category/ontbijt/" title="Alle berichten bekijken in Ontbijt" rel="category tag">Ontbijt</a>, <a href="http://localhost/sm/category/snacks/" title="Alle berichten bekijken in Snacks" rel="category tag">Snacks</a></h3>
</div>
</div>
</article>
,
更改
<a href="<?php the_permalink(); ?>">
他的问题是附加的锚定标签,这不是解决方案。我需要@Howlin是正确的,因为永久链接不是一个空白的锚。你的文档是什么DOCTYPE?我这样问是因为你的目标HTML在HTML5之前的任何东西中都是无效的,主要是因为。您的实际输出是否正常,但您的浏览器正在更正内存中的DOM以使其有效,这就是您看到的情况?你到底是如何检查输出的?(对我来说,线索是您的
在它的第一个非内联元素
之前关闭了),所以它应该正常工作?我如何检查它的输出被张贴在我最初的帖子底部。我已经在Chrome和Firefox中检查过了。奇怪的是,我在添加WordPress标签之前已经对结构进行了编码,一切都很好。包含WordPress标记后,代码似乎已被破坏。在WordPress设置中的“设置->编写”下,是否选中了“WordPress应自动更正无效嵌套的XHTML”?不,未选中
<a href="<?php the_permalink(); ?>">
<a href="#">