关闭PHP标记以停止链接出现在不需要的位置(Wordpress)
此处的最后一个链接()附加到我的“特色标题文本”标题。我没有正确关闭php标记吗关闭PHP标记以停止链接出现在不需要的位置(Wordpress),php,wordpress,hyperlink,Php,Wordpress,Hyperlink,此处的最后一个链接()附加到我的“特色标题文本”标题。我没有正确关闭php标记吗 <?php get_header(); ?> <?php if(of_get_option('show_infoboxes') == true) { ?> <div class="promo"> <section class=" block grid4"> <div class="col">
<?php get_header(); ?>
<?php if(of_get_option('show_infoboxes') == true) { ?>
<div class="promo">
<section class=" block grid4">
<div class="col">
<?php if(of_get_option('infobox_image_1')) { ?> <a href='http://www.facebook.com/waxworkfigurine'><img src="<?php echo of_get_option('infobox_image_1') ?>"</a> <?php } ?>
<?php echo of_get_option('infobox_text_1') ?>
</div>
<div class="col">
<?php if(of_get_option('infobox_image_2')) { ?> <a href='https://twitter.com/waxworkfigurine'><img src="<?php echo of_get_option('infobox_image_2') ?>" alt=""</a> <?php } ?>
<?php echo of_get_option('infobox_text_2') ?>
</div>
<div class="col">
<?php if(of_get_option('infobox_image_3')) { ?> <a href='https://soundcloud.com/waxworkfigurine'><img src="<?php echo of_get_option('infobox_image_3') ?>" alt=""</a> <?php } ?>
<?php echo of_get_option('infobox_text_3') ?>
</div>
<div class="col">
<?php if(of_get_option('infobox_image_4')) { ?> <a href='https://soundcloud.com/waxworkfigurine2'><img src="<?php echo of_get_option('infobox_image_4') ?>" alt=""</a> <?php } ?>
<?php echo of_get_option('infobox_text_4') ?>
</div>
</section>
</div>
<?php } ?>
<section class="featured block grid2">
<h2><?php echo of_get_option('featured_header_text') ?></h2>
您应该使用分号终止所有行,例如
<h2><?php echo of_get_option('featured_header_text'); ?></h2>
此外,我发现这样做更容易:
<?php if(of_get_option('infobox_image_4')) : ?> <a href='https://soundcloud.com/waxworkfigurine2'><img src="<?php echo of_get_option('infobox_image_4'); ?>" alt="" /></a> <?php endif; ?>
您需要正确关闭
“alt=”“>
^-----
您缺少img的结束标记,请在
之前添加
适当的代码间距可以为您节省大量类似这样的小错误,它需要更多的空间,但更清晰、更易于阅读。特色标题文本的内容是什么?“新闻”文本标题的预期结果是什么,您会得到什么?预期结果只是文本新闻-实际结果=文本新闻,带有指向的超链接您所有的图像标签都缺少一个结束符
如果只有一个操作,则不需要分号。更改为“应该”-这是一个很好的做法。还注意到您缺少结束图像标签,因此也添加了此项。Brill,很容易漏掉像这样的位和位:)为什么要进行向下投票?如果您看到一些我的帖子有问题,请评论一下,只是否决投票是没有价值的。。。
<img src="<?php echo of_get_option('infobox_image_3') ?>" alt=""></a>
^-----
<div class="col">
<?php if(of_get_option('infobox_image_4')) { ?>
<a href='https://soundcloud.com/waxworkfigurine2'>
<img src="<?php echo of_get_option('infobox_image_4') ?>" alt="" />
</a>
<?php } ?>
<?php echo of_get_option('infobox_text_4') ?>
</div>