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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -