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

Commented code in Wordpress template?

programmeradmin2浏览0评论

I have a wordpress site that has to integrate with a .NET platform for a client. I simply need to add two commented out pieces of HTML for it to work on the .NET platform end (not our system).

Wordpress keeps stripping it out of the custom template, though. Is there a way around this?

Note: This is not done in the backend editor. This is directly in the template php file that I'm placing these two commented lines of code.

Also note: I already tried Linklays function to modify tinymce to see if that would be a solution, but again this isn't using tinymce since it's hard-coded into the template.

Edit: Template Code:

I have a wordpress site that has to integrate with a .NET platform for a client. I simply need to add two commented out pieces of HTML for it to work on the .NET platform end (not our system).

Wordpress keeps stripping it out of the custom template, though. Is there a way around this?

Note: This is not done in the backend editor. This is directly in the template php file that I'm placing these two commented lines of code.

Also note: I already tried Linklays function to modify tinymce to see if that would be a solution, but again this isn't using tinymce since it's hard-coded into the template.

Edit: Template Code:

Share Improve this question edited Dec 18, 2019 at 17:38 Crystal Groves asked Dec 18, 2019 at 17:06 Crystal GrovesCrystal Groves 11 bronze badge 8
  • Please show some code (limited to the problem). Just from the text I don't really have an idea what you're currently doing. – kero Commented Dec 18, 2019 at 17:27
  • ` <div class="container"> <div class="primary-content"> <?php the_content(); ?> <h2><!--WebLink:ContentTitle--></h2> <!--WebLink:BodyContent1--> </div> </div> ` the commented out lines do not show, no matter what I do. – Crystal Groves Commented Dec 18, 2019 at 17:30
  • When you say the template PHP, how are you editing the template PHP? Is this the template file on the server? Are you making the changes then FTP'ing them up? Or are you using one of those dangerous plugins that let you put PHP directly into the database and run it? It's not clear, screenshots would be helpful! – Tom J Nowell Commented Dec 18, 2019 at 17:34
  • Edited to include a screenshot of the template file with the commented code. The h2 shows up empty, the commented code doesn't show on inspect. I've tried doing this multiple ways and just haven't figured it out yet. – Crystal Groves Commented Dec 18, 2019 at 17:38
  • How should WordPress/PHP know, what <!--WebLink:ContentTitle--> means? – kero Commented Dec 18, 2019 at 17:56
 |  Show 3 more comments

1 Answer 1

Reset to default 0

Figured this out, autoptimize strikes again.

发布评论

评论列表(0)

  1. 暂无评论