bbPress functions with the word “get” in them do not self-echo, they simply return the string. So you have to add echo. You almost have it, for example, this should work:
<a href="<?php echo bb_get_profile_link(); ?>">My Profile</a>
And just to confuse you, there are a couple of legacy functions with the word “get” in them that do echo. But they shouldn’t and are rare so don’t worry too much, lol.
I tried that and this is what I get as the url of the link:
parthatel: can you post your actual HTML from the rendered page in backticks so it doesn’t get rendered as HTML? Like you did in the first post. Thanks.
This is the warning that appears on the top of the page.
<b>Warning</b>: parse_url(/%3Ca%20href=%27http://mydomain.com/links/profile.php?id=2%27%3EView%20your%20profile%3C/a%3E) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in <b>/home/domain/public_html/links/bb-includes/functions.php</b> on line <b>1794</b>
This is what the My Profile link links to:
bb_get_profile_link does self echo, so you could try:
<a href="<?php echo user_profile_link(bb_get_current_user_info('id')); ?>/">
…or if you don’t want to use it amongst another href, just use:
<?php echo bb_profile_link('link text here'); ?>
bb_get_profile_linkdoes not self echo but it does return a full formed url apparently, so I was half wrong to use it inside of a href.
The direct link is via
get_user_profile_link( $id )
byles, your code is wrong in that it doesn’t need an echo
<?php bb_profile_link('link text here'); ?>
- You must be logged in to reply to this topic.