skip to Main Content

I have finish all my html pages and now I want to add them inside the 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.

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

2

Answers


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

    <li class="menu-item">  <a href="<?= the_permalink('/aboutus.html'); ?>"> AboutUs</a> </li>
    
    Login or Signup to reply.
  2. <li class="menu-item">  <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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search