Hook:
User: user-profile.tpl.php
For printing fields of profile2
Condition: <?php
if((arg(0)=='user') && is_numeric(arg(1)))
{
$profile = profile2_load_by_user(arg(1));
Modules or views used :
Profile2(profile2): Its proveds a default content type where we can add custom fields from manage fields like i used here
• About me where user can add a small description about him or her
• Social links : facebook url and linkedin url
• Example http://www.dna2life.com/users/srirupa
For user related post for any particular user we used a View, here are following steps:
Add a new view, i used name User_related_post
Choose block because we need to show other things also in author pages
Filter criteria :
Content: Published (Yes)
Content: Type (= Article)
Sort Criteria:
Content: Post date (desc)
Contextual filters
Global: Null
(author) User: Uid
When the filter value is NOT available
Provide default value : Raw value from url
Relationships
Content: Author
(author) User: Profile