Is this possible? I'm working with Wordpress for my site, and wanted to do some customization of my theme. The theme displays a tiny bit of info about the author of each post like the username they login with, how many posts they've written, and if they give a "bio" about themselves it includes that too...
What I want to do is to add a small bit of funny text below where it tells how many posts the user has made via PHP. I've found a script I'm using right now which I have gotten to work just fine. The problem is, some of the phrases I want to use would require to display the user's name (their login name), but I can't seem to figure out how to put that variable inside the array of things to say.
Here's the code, then below that I'll post the variation I tried to call the users' names.
The first code is what wordpress uses internally to call the post author's username/nickname
The second code is the random phrase script
PHP Code:<?php echo $curauth->nickname; ?>Now here is what I added to try and call the user's nickname into the array...PHP Code:<?php
$slyterm[] = '...We think';
$slyterm[] = 'Yes, we\'re counting.';
$slyterm[] = 'Support your <del>local</del> <strong><del>global</del></strong> <strong>GALACTIC</strong> writer people!';
$slyterm[] = 'We are assuming this one was written with "love" as well... (no guarantees)';
$slyterm[] = 'The buzz on the street is that this post was written with <em>love</em>...';
srand ((double) microtime() * 1000000);
$random_number = rand(0,count($slyterm)-1);
echo ($slyterm[$random_number]);
?>
PHP Code:$slyterm[] = 'We believe that $curauth->nickname only writes these to get the attention they were lacking as a child...';



Reply With Quote



Bookmarks