Home > other >  How to call .hmtl file inside the header.php in wordpress?
How to call .hmtl file inside the header.php in wordpress?

Time:06-24

I have finish all my html pages and now I want to add them inside the header.php.

Please see the code below:

<li >  <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.

Can you please tell me how to ge to my point?

CodePudding user response:

You do not output anything from PHP. Change <?php to <?=:

<li >  <a href="<?= the_permalink('/aboutus.html'); ?>"> AboutUs</a> </li>

CodePudding user response:

<li >  <a href="<?php echo $location_of_file .'/aboutus.html'; ?>"> AboutUs</a> </li>

$location_of_file will contain address to aboutus.html file without slash at the end.

  • Related