Title: Current Link?
Last modified: August 19, 2016

---

# Current Link?

 *  [benz0r](https://wordpress.org/support/users/benz0r/)
 * (@benz0r)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/current-link/)
 * I need a code snippet just like: `<?php the_permalink();?>` which works with 
   the home page as well.
 * For example:
 * _Right now,_ If I were to put this code in my index.php it would output the permalink
   to the first post. But it works fine on the posts. I need something similar that
   _works_ on the index.php, so it would output: [http://example.com/](http://example.com/)
   instead of the permalink to the first post.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/current-link/#post-1321939)
 * try and use `<?php bloginfo('url'); ?>`
 *  Thread Starter [benz0r](https://wordpress.org/support/users/benz0r/)
 * (@benz0r)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/current-link/#post-1322014)
 * That won’t work, I’m trying to use one global tag. I figured it out though.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Current Link?’ is closed to new replies.

## Tags

 * [index](https://wordpress.org/support/topic-tag/index/)
 * [link](https://wordpress.org/support/topic-tag/link/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [root](https://wordpress.org/support/topic-tag/root/)

 * 2 replies
 * 2 participants
 * Last reply from: [benz0r](https://wordpress.org/support/users/benz0r/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/current-link/#post-1322014)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
