<?php the_author_posts_link(); ?>
to make it a link to all posts by that author
or
<?php the_author(); ?>
to just display the name
This code is not working when I add it to the page. Just to clarify, I am doing this through wp-admin/page.php Is that possible?
Cheers,
Will
OK, update, I have installed a plugin that allows me to use PHP, so the code does now work.
However, it is the wrong code, I need the user who is READING the posts username. To say, Hey, USERNAME, kinda thing.
Can anyone help please?
Will
You could try something like:
<?php if(is_user_logged_in() ) :?>
<p>Hey <?php echo $user_identity; ?></p>
<?php endif;?>
That code did not work, found something on a wiki that works though –
global $current_user;
get_currentuserinfo();
echo ' . $current_user->user_login . ';
Hopefully that helps anyone else that needs it.
I am integrating the users username into a URL, is there any way I can stop WordPress from adding my blogs url to the beginning of the url? Its doing this –
http://www.myurl.com/http://www.url-its-suppose-to-be.com
Cheers,
Will
You’ll have to generate a full, absolute, url.