Creating Menu Links in a Custom Theme

I’m building a custom theme for my own portfolio and I’m just going to use the static menus I have in HTML template design.

Within this though I would like to add a function that sets the link address. I’m using the code below for the about page and it works, but is this the best way to do this? I’m new to custom themes so wanted to check in case there is a better, or “best-practice” way to do this.

Just to re-iterate I don’t want to use dynamic menus linked to the backend menu controls.

Many thanks,

HTML / PHP

<li class=”menu-item menu-item-1″>
<a href=”<?php echo esc_url(home_url( ‘/about’ ));?>”>ABOUT</a>
</li>

Read more here:: Creating Menu Links in a Custom Theme

Leave a Reply

Your email address will not be published. Required fields are marked *