WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanna show the blog URL instead of the whole post URL in my loop.

The reason is that I use Wordpress multiblog with sitewide tags, so on my front-page of the main blog I'm showing the 10 last posts globally. I wanna show the blogdomain the post is coming from.

the_permalink works if I wanna show the whole post-url but I need to cut it down to show only the domain.

Can anyone help me?

share|improve this question
up vote 0 down vote accepted

Use parse_url():

echo parse_url( get_permalink(), PHP_URL_HOST );
share|improve this answer

I think your looking for the function get_site_url( $blog_id );

$blog_id is the ID of the blog where your post is from.

More info: http://codex.wordpress.org/Function_Reference/get_site_url

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.