Drupal, how to remove author and time in search results page

We use a preprocess function to remove elements you don’t need

Insert this code snippet  in your theme’s template.php and change THEMENAME to your theme’s name. Comment what you don’t need (delete user + date, delete user or delete date)

function THEMENAME_preprocess_search_result(&$vars) {
  //delete user + date
  $vars['info'] = "";

  //delete user
  $vars['info'] = $vars['info_split']['date'];

  //delete date
  $vars['info'] = $vars['info_split']['user'];

Display specific BuddyPress user’s avatar


Print out User Avatar from User ID in Buddypress.

echo bp_core_fetch_avatar ( array( 'item_id' => $member_id, 'type' => 'full' ) )


This code will display the user avatar by user ID and also make the avatar a clickable link to their profile.


// replace the number in the first line with the userID that you want.
$member_id = bp_core_get_userid( '1' )

<a href="<?php echo bp_core_get_user_domain( $member_id ) ?>" 

title="<?php echo bp_core_get_user_displayname( $member ) ?>">

echo bp_core_fetch_avatar ( array( 'item_id' => $member_id, 'type' => 'full' ) ) ?></a>

How to print a list of all taxonomy terms assigned to a node?

Drupal 7

Code snippet to print the terms associated to a node in Drupal 7


// we get the node ID
if (arg(0) == 'node' && is_numeric(arg(1))) {
    $nid = arg(1);

$node = node_load($nid);

// grab all terms without specifying field names and no db_query:
function example_get_terms($node) {
    $terms = array();

    foreach (field_info_instances('node', $node->type) as $fieldname => $info) {
        foreach (field_get_items('node', $node, $fieldname) as $item) {
            if (is_array($item) && !empty($item['tid']) && $term = taxonomy_term_load($item['tid'])) {
                $terms[] = $term->name;
    return $terms;

$terms = example_get_terms($node);