AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Solved] show Number of views below subscribe button

6 Posts
2 Users
2 Reactions
2,657 Views
netvilox
Posts: 64
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@netvilox)
Estimable Member
Joined: 7 years ago
[#12989]

Please I need a code to show Number of views below the subscribe button. As shown in the picture below. It will look like 

345 views 

 Screenshot 20200409 125539

Topic Tags
5 Replies
Robert
Posts: 10728
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 2 months ago

Hi @netvilox,

The number of views is not counted for forums. It's only counted for topics. Each topic has its number of views. I'm sorry but there is no total number of views in wpForo.


1 Reply
netvilox
(@netvilox)
Joined: 7 years ago

Estimable Member
Posts: 64
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@robert

Thanks for your reply sir, but what I mean is how to show Number of views a topic has below its subscribe button. See image below 

 Screenshot 20200410 171329

netvilox
Posts: 64
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@netvilox)
Estimable Member
Joined: 7 years ago

Just like its done on this forum 

 Screenshot 20200413 101344

Robert
Posts: 10728
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 2 months ago

Hi @netvilox,

You can do this in update safe way by customizing wpForo post.php template file.

1. Create /wpforo/ folder in your WordPress active theme folder, if you have child theme in the child folder.

2. Copy /wp-content/plugins/wpforo/wpf-themes/classic/post.php file to just created /wpforo/ folder. Use some FTP client or your hosting service File Manager.

3. Edit the post.php, find this code line:

<div class="wpf-action-link"><?php WPF()->tpl->topic_subscribe_link() ?></div>

4. Add this code below that line:

<div class="wpf-topic-views"><?php echo __('Topic Views', 'wpforo') . ': ' . number_format($topic['views']); ?></div>

 

The documentation: https://wpforo.com/docs/root/forum-themes/theme-customization/

 


netvilox
Posts: 64
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@netvilox)
Estimable Member
Joined: 7 years ago

Thank you very much sir you and WPforo teams are always here to help us out anytime. The code worked thanks you very much sir, am so happy. 


Share: