Show user picture on certain content types only

Last modified: June 11, 2008 - 13:59

Theme settings let you choose which content types show post information (ie the 'submitted by...' line). However, display of user pictures is an all or nothing setting.

Here's a snippet for node.tpl.php to choose whether content types show a user picture with the post information or not:

  <?php if ($picture && in_array($node->type, array('blog', 'othertype', 'etc')))
      print
$picture; // only want picture on certain content types
   
?>

Note that your theme settings should have pictures enabled for this to work.

very nice :D worked like a

impete82 - April 5, 2009 - 22:50

very nice :D worked like a charm

 
 

Drupal is a registered trademark of Dries Buytaert.