In the literature of social networks research, community detection algorithms and hashtag recommendation models have been studied extensively but treated separately. Community detection algorithms study the inter-connection between users based on the social structure of the network. Hashtag recommendation models suggest useful hashtags to the users while they are typing in their tweets. In this paper, we aim to bridge the gap between these two problems and consider them as inter-dependent. We propose a new hashtag recommendation model which predicts the top-y hashtags to the user based on a hierarchical level of feature extraction over communities, users, tweets and hashtags. Our model detects two pools of users: in the first level, users are detected using their topology-based connections; in the second level, users are detected based on the similarity of the topics of the tweets they previously posted. Our hashtag recommendation model finds influential users, reweighs their tweets, searches for the top-n similar tweets from the tweets pool of users who are socially and topically related. All hashtags are then extracted, ranked and the top-y are recommended. Our model shows better performance of the recommended hashtags than when considering the topology-based connections only.