最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - I have a random letter appearing before my content. Where to start looking for the cause?

programmeradmin2浏览0评论

Something weird is happening. I'm running Wordpress on a local DesktopServer. Suddenly, as in today, the letter "d" has started appearing before my content is random places.

In short, it appears on a line before my page content, above the site header. If I check the page source, the letter is immediately after the body tag. It happens on both content and admin pages.

The letter also appears at the beginning of a custom taxonomy list on the editor screen. If I start to enter a tag, something inserts the letter before the dropdown suggestions. If I'm typing "widget," I would enter the word as "dwidget."

I haven't installed any new plugins or themes recently, but I am writing a custom plugin, mostly to help a custom post type interface with a web API, but none of my recent changes have anything to do with the API.

I recently added a custom taxonomy, but I removed that from the code, and it didn't help the problem.

I'm using Pods for the custom post types, if that's relevant.

I'm not looking for answers, just some suggestions where to start looking for the cause (other than searching for every occurrence of the letter "d" in my code).

Something weird is happening. I'm running Wordpress on a local DesktopServer. Suddenly, as in today, the letter "d" has started appearing before my content is random places.

In short, it appears on a line before my page content, above the site header. If I check the page source, the letter is immediately after the body tag. It happens on both content and admin pages.

The letter also appears at the beginning of a custom taxonomy list on the editor screen. If I start to enter a tag, something inserts the letter before the dropdown suggestions. If I'm typing "widget," I would enter the word as "dwidget."

I haven't installed any new plugins or themes recently, but I am writing a custom plugin, mostly to help a custom post type interface with a web API, but none of my recent changes have anything to do with the API.

I recently added a custom taxonomy, but I removed that from the code, and it didn't help the problem.

I'm using Pods for the custom post types, if that's relevant.

I'm not looking for answers, just some suggestions where to start looking for the cause (other than searching for every occurrence of the letter "d" in my code).

Share Improve this question edited Apr 27, 2020 at 19:09 Paul asked Apr 27, 2020 at 18:24 PaulPaul 92 bronze badges 8
  • I've determined that the problem is connected to my custom plugin. When I enable it, I get the following message: "The plugin generated 1 character of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin." – Paul Commented Apr 27, 2020 at 18:32
  • The letter is immediately after which tag? <body>? – Tony Djukic Commented Apr 27, 2020 at 18:32
  • Yes. the HTML shows <body class=".....">"d" – Paul Commented Apr 27, 2020 at 18:34
  • Are you enqueuing any scripts or styles with your custom plugin? If you are, look through that entire section to see if there's an errant "d" in there. It sounds like what you have is an accidental keystroke (I had a cat mangle a site once with one paw swipe while I refilled my coffee) that is sitting outside of where it's supposed to be and your script enqueueing is taking that errant character and just placing it immediately within the body tag. – Tony Djukic Commented Apr 27, 2020 at 18:38
  • I don't do any enqueuing in the plug-in. All of that is done in the theme. – Paul Commented Apr 27, 2020 at 18:45
 |  Show 3 more comments

1 Answer 1

Reset to default 0

There was a "d" just before the opening php tag in one of my files. I'm a dork.

发布评论

评论列表(0)

  1. 暂无评论