php - Generating href with a function -
i trying write custom wordpress theme.
i put in header.php
:
<h1>roux academy of art , design <a href="<?php echo siteroot('blog'); ?>index.htm" title="home"></a> </h1>
i'd the link inside h1
point index.html
, when add php bit inside href
disappears , blank page.
i have in functions.php
:
<?php function siteroot($thefolder) { $home = get_home_url(); // strpos(string, substring) $theposition = strpos($home,$thefolder); // substr (string, start, length) $thepath = substr($home, 0, $theposition); return $thepath; } ?>
what problem be?
i try code in header.php still not working
<h1>roux academy of art , design<a href=" <?php echo esc_url( home_url( '../../../blog/roux_academy/index.html' ) ); ?>
why not way?
<h1>roux academy of art , design <a href="<?php home_url(); ?>/index.htm" title="home"></a> </h1>
Comments
Post a Comment