Display URL of a child site blog to visitors
-
I am trying to display a “Visit My Blog” link on my BP profile page and the code below works when a user is logged in, but when a user is not logged in the “Visit My Blog” takes them to the main blog (domain.com), not the users blog (domain.com/user).
<a href="<?php echo home_url() . '/' . get_the_author_meta( 'user_login', wp_get_current_user()->ID ); ?>" >Visit My Blog</a>
If I take out the ‘user_login’ part it takes them straight to the main blog also. Any ideas on how to get the correct link to display to visitors?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display URL of a child site blog to visitors’ is closed to new replies.