Author display name inside the loop ?
-
Hello there,
I’m so not good at php (not to say my knowledge is non-existent), but there’s this one little thing i need to do for tomorrow arghh. I’ve been reading a lot and i’m slowing getting into it.. but.. it’s late -_-
Trying to ‘better’ a plugin that displays posts titles in columns, I can’t seem to display the author’s name of the corresponding title right under the said title.
here is what i have so far ( am posting the code that displays the title as i suspect the CORRECT author’s name can be extracted from a variable in there… but i just don’t know how to.
// do we need to cut down post title? if ( $shorten ) { if ( $titlelen && mb_strlen_dh($post->post_title) > ($titlelen+1) ) { $title = substr_utf8($post->post_title, 0, $titlelen)."…"; } else { $title = $post->post_title; } $title_full = $post->post_title; } else { $title_full = $title = $post->post_title; } $title = htmlspecialchars(str_replace('"', "", $title)); $title_full = htmlspecialchars (str_replace('"', "", $title_full)); $ppc_str .= ' <li><a href="'.get_permalink($post->ID).'" class="ppc-post-title" title="'.sprintf(__('Article %s published at %s', 'ppc'), $title_full, date_i18n(__('F j, Y g:i a'), strtotime($post->post_date)) ).'">'.$title.'</a>';
and here comes my bit right after :
`//extract meta data : author name / date of publication
$ppc_str .= ‘<p class=”meta-info”>’.get_the_author().'</p>’;
`the result is that the author ‘id’ of the current admin (me) is being output. not what i want.. my head hurts.. the plugin author doesn’t reply ANYONE whatever the question is.
Can someone help a little ?
- The topic ‘Author display name inside the loop ?’ is closed to new replies.