I created a node--blog.tpl.php file and I styled the date of post to a custom style using the following
<?php if ($display_submitted): ?>
<div class="dateblock">
<footer class="month"><?php print $date_month ?></footer>
<footer class="day"><?php print $date_day ?></footer>
<footer class="year"><?php print $date_year ?></footer>
</div>
<footer class="submitted<?php $user_picture ? print ' with-user-picture' : ''; ?>">
<?php print $user_picture; ?>
</footer>
but all I see is the date block that I created how can I add JUST the author name back in there? I tried something like
<div class="meta post-info">
<?php if ($submitted): ?>
<footer class="submitted">Posted by <?php print theme('username', $node) ?></footer>
<?php endif; ?>
but its not working, does anyone have any idea what I need to change?
Comments
Comment #1
scampbell70 commentedI got it a little closer I made the following change
Posted By
print theme('username')But it prints out anonymous as the user name on everything
Comment #2
scampbell70 commentedfixed it sorry for the un-needed post
Comment #3
Jeff Burnz commentedCan you report back how you fixed this - it could be interesting for other users. Cheers.
Comment #4
scampbell70 commentedSorry I am not sure how to properly post code, so I hope this makes sense. To show only the author name and no date first turn off display author information in the content type. Then in the node.tpl.php file that you want to change find this line and edit whats below it
and change it to read
To customize the posted date and display author first turn off display author infomation in the content type then add the following to your template php file
Then in the node.tpl.php file that you want to change find this line and edit whats below it
and change it to read
print $date_monthprint $date_dayprint $date_year$user_picture ? print ' with-user-picture' : ''; ">
print $user_picture;Posted By
print $name;endif;Then all you have to do is style it with css. Something like
I hope this helps someone, it took me a few days of intense searching to peice it all together.
Comment #5.0
(not verified) commentedUpdated issue summary.