Fóruns
The great place to discuss topics with other users
Add hashtags to landing page
'By default, trending hashtags are only shown if users are logged in or your site has a public newsfeed. Let's make them usefull for any page.
🛠️ Open root/index.php and find:
// get trending hashtags
if (!(!$user->_logged_in && !$system['newsfeed_public']) && $system['trending_hashtags_enabled']) {
$trending_hashtags = $user->get_trending_hashtags();
$smarty->assign('trending_hashtags', $trending_hashtags);
}
Replace it with:
// get trending hashtags (ScriptsTribe modification)
if ($system['trending_hashtags_enabled']) {
$trending_hashtags = $user->get_trending_hashtags();
$smarty->assign('trending_hashtags', $trending_hashtags);
}
✅ Now you can add this in your landing page template (e.g. landing.tpl):
<!-- trending -->
{if $trending_hashtags}
{include file='_trending_widget.tpl'}
{/if}
<!-- /trending -->
📍 Want to show hashtags on other pages too (like profile.php, explore.php, etc)? You must add the same PHP logic there to assign $trending_hashtags before using it in the template.
By default, trending hashtags are only shown if users are logged in or your site has a public newsfeed. Let's make them usefull for any page.
🛠️ Open root/index.php and find:
// get trending hashtags
if (!(!$user->_logged_in && !$system['newsfeed_public']) && $system['trending_hashtags_enabled']) {
$trending_hashtags = $user->get_trending_hashtags();
$smarty->assign('trending_hashtags', $trending_hashtags);
}
Replace it with:
// get trending hashtags (ScriptsTribe modification)
if ($system['trending_hashtags_enabled']) {
$trending_hashtags = $user->get_trending_hashtags();
$smarty->assign('trending_hashtags', $trending_hashtags);
}
✅ Now you can add this in your landing page template (e.g. landing.tpl):
<!-- trending -->
{if $trending_hashtags}
{include file='_trending_widget.tpl'}
{/if}
<!-- /trending -->
📍 Want to show hashtags on other pages too (like profile.php, explore.php, etc)? You must add the same PHP logic there to assign $trending_hashtags before using it in the template.