gpt4 book ai didi

css - 我试图在我的 Wordpress 主页中删除 "mystery carriage return"

转载 作者:太空宇宙 更新时间:2023-11-03 21:53:02 25 4
gpt4 key购买 nike

事实如下:

  • Wordpress 主题父级:Pytheas(我使用的是子主题)
  • 网站:http://longgame.org
  • 我是初学者。我仍在学习 CSS 的基础知识。

我的问题:

在首页上,有一组五个“亮点”,我将在其中插入文本。请注意下图(描绘了最左边的两个):

I can't figure out where this yellow-area is being generated

那个黄色突出显示的区域表示我似乎无法删除的区域。我做了以下事情:

  • 检查 HTML 元素以确认没有意外回车。
  • 删除了内容,下一个 元素 - “关于”宣传语“滑过”并表现出相同的行为。
  • 搜索了我的子主题以确定我是否搞砸了(毫无疑问是问题所在,但我找不到)。

我不知道这是什么时候开始发生的,但在过去的几天里,我一直在尝试所有这些 Wordpressy 的东西。

如前所述,我是初学者。如果我可以提供更多数据以提高更正此问题的几率,请告诉我。

提前感谢您提供的任何建议。

编辑:我不确定是什么代码,尤其是罪魁祸首,特别是因为我什至不知道如何编辑任何类似 php 的东西。我从来没有尝试过。 :)

无论如何,也许这来自父主题?它来自 home-highlights.php - 如果我跑题了请告诉我。

            <div class="grid-container clearfix">

<?php
$count=0; //set counter var
foreach($hp_highlight_posts as $post) : setup_postdata($post); //start loop
$count++; //increase counter var with each post in loop

//meta
$hp_highlights_url = get_post_meta($post->ID, 'wpex_hp_highlights_url', TRUE);
$hp_highlights_icon = get_post_meta($post->ID, 'wpex_hp_highlights_icon', TRUE);
?>

<div class="hp-highlight grid-5 <?php echo $post->ID; ?>">
<h3>
<?php
//display icon if option not set to default
if($hp_highlights_icon !='Select') { ?>
<span class="wpex-icon-<?php echo $hp_highlights_icon; ?>"></span>
<?php } //highlight meta option set to "Select" ?>
<?php
//show the highlight title as a link
if(!empty($hp_highlights_url)) { ?><a href="<?php echo $hp_highlights_url; ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php }
//show plain title because link option is blank
else { the_title(); } ?>
</h3>
<?php
//show the post content
the_content(); ?>

感谢礼仪反馈。下次我会做得更好。 :)

进一步研究:

这有关系吗? : Why is &#65279; appearing in my HTML?

最佳答案

您在 h3 标签和 p 标签之间有一些额外的空格..尝试删除此文本之前的那些空格 <p>This the digital notebook of Matt Warren. Thanks for stopping by.</p>

尝试使用Firebug

您当前的 HTML 包含空格 -

<div class="hp-highlight grid-5 13699"> 
<h3><span class="wpex-icon-home"></span>
Welcome
</h3>
&#65279;<p>This the digital notebook of Matt Warren. Thanks for stopping by.</p>
</div>

在上面的代码中你有&#65279;那就是 Unicode字符“零宽度不间断空间”(U+FEFF)

我相信您从不同的文件/位置复制了内容,其中默默地包含了这些空格。

关于css - 我试图在我的 Wordpress 主页中删除 "mystery carriage return",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16003623/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com