user3550879
user3550879

Reputation: 3469

Linking to 'Home' from functions.php

I have the following code in my functions.php file (Wordpress)Which creates my back/next navigation. I want to add a link in the middle column (Bootstrap) which links to my home page

<?php if ( is_single() ) : // navigation links for single posts ?>

  <?php previous_post_link( '<div class="col-xs-4"><div class="nav-previous">%link</div></div>', _x( '', 'Next post link', 'bnNav' ). '<span class="fa fa-chevron-left"></span><span class="back">BACK</span>'); ?>

  <div id="test" class="col-xs-4"> ... Link to home ...</div>

  <?php next_post_link( '<div class="col-xs-4"><div class="nav-next">%link</div></div>', '<span class="next">NEXT</span><span class="fa fa-chevron-right"></span>' . _x( '', 'Previous post link', 'bnNav' ) ); ?>

...

Upvotes: 0

Views: 26

Answers (1)

Darren
Darren

Reputation: 13128

Wouldn't you simply put a link anchor - <a>?

<div id="test" class="col-xs-4">
    <a href="/">Home</a>
</div>

Alternatively - you could simply put your full url (i.e. http://www.google.com) instead of /.

A note: since you're using WordPress, you could also use get_home_url(); too:

<a href="<?php echo get_home_url(); ?>">Home</a>

Upvotes: 1

Related Questions