[英]How to call .hmtl file inside the header.php in wordpress?
I have finish all my html pages and now I want to add them inside the header.php.我已经完成了所有的 html 页面,现在我想将它们添加到 header.php 中。
Please see the code below:请看下面的代码:
<li class="menu-item"> <a href="<?php the_permalink('/aboutus.html'); ?>"> AboutUs</a> </li>
As you can see Iam using the_permalink function to call the html file , but when I click in the navbar the aboutus nothing happen , I dont get the aboutus.html.正如您所看到的,我使用 the_permalink 函数来调用 html 文件,但是当我在导航栏中单击时,什么都没有发生,我没有得到 aboutus.html。
Can you please tell me how to ge to my point?你能告诉我如何理解我的观点吗?
You do not output anything from PHP.您不会从 PHP 输出任何内容。 Change <?php
to <?=
:将<?php
更改为<?=
:
<li class="menu-item"> <a href="<?= the_permalink('/aboutus.html'); ?>"> AboutUs</a> </li>
<li class="menu-item"> <a href="<?php echo $location_of_file .'/aboutus.html'; ?>"> AboutUs</a> </li>
$location_of_file 将包含 aboutus.html 文件的地址,末尾没有斜线。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.