How can I replace html elements with php? -
i have website in use html, i'd add 1 location edit things nav , footer. instantly updated across whole site.
so, example, i'd put:
<nav> <div class="nav-wrapper"> <a href="#" class="brand-logo">logo</a> <ul id="nav-mobile" class="right hide-on-med-and-down"> <li><a href="sass.html">sass</a></li> <li><a href="badges.html">components</a></li> <li><a href="collapsible.html">javascript</a></li> </ul> </div> </nav>
into
<?php echo $nav;?>
any appreciated! =)
add html want show file. eg:
add menu.html
<nav> <div class="nav-wrapper"> <a href="#" class="brand-logo">logo</a> <ul id="nav-mobile" class="right hide-on-med-and-down"> <li><a href="sass.html">sass</a></li> <li><a href="badges.html">components</a></li> <li><a href="collapsible.html">javascript</a></li> </ul> </div> </nav>
now include page in other html pages wherever want call below
<?php include 'menu.html'; ?>
Comments
Post a Comment