Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 0 down vote accepted

Use parse_url():

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

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
add comment

Your Answer

 
discard

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.