What would be the best way to have Twitter ID link show next to author name in my content type?
Something like: Submitted by Username (@twitterid)

Comments

sagar ramgade’s picture

Hi,
You can modify the function mentioned below in your active theme's template.php :

<?php
/**
 * Format the "Submitted by username on date/time" for each node
 *
 * @ingroup themeable
 */
function yourtheme_node_submitted($node) {
  return t('Submitted by !username on @datetime',
    array(
      '!username' => theme('username', $node),
      '@datetime' => format_date($node->created),
    ));
}
?>

You need first pull the users twitter id and then use it inside this function.
Hope this helps.

Regards
Sagar

Acquia certified Developer, Back end and Front specialist
Need help? Please use my contact form

ayesh’s picture

Since twitter name is an optional input, make sure that you add if commands in the theme's template.php before asking theme to print it - avoid errors.

Check twitter module's doc for adding the twitter name in theme.