Notifications
Clear all

wpForo 1.x.x Date of last post

15 Posts
3 Users
4 Likes
760 Views
adriaan
Posts: 47
Topic starter
(@adriaan)
Eminent Member
Joined: 2 years ago

Hello,

Is it possible to display the date of the last post? Instead of "1 year ago" we would like the date to be there. Is that possible?

best regards

14 Replies
Tutrix
Posts: 669
(@tutrix)
Prominent Member
Joined: 2 years ago

@adriaan

you have to edit the forum.php of your used layout

the best way to do this > Theme Customization

open the forum.php

and search for

<?php wpforo_date($forum['last_post_date']) ?>

and replace with

<?php wpforo_date($forum['last_post_date'], 'd/m/Y g:i a') ?>
Reply
2 Replies
adriaan
(@adriaan)
Joined: 2 years ago

Eminent Member
Posts: 47

@tutrix 

i cant find the line

<?php wpforo_date($forum['last_post_date']) ?>
Reply
Tutrix
(@tutrix)
Joined: 2 years ago

Prominent Member
Posts: 669

@adriaan 

search for date

and add after  „ ] „

, 'd/m/Y g:i a'

 

example

 

Layout 1 forum.php

<?php wpforo_date($topic['modified']); ?>

Layout 2 forum.php

<?php wpforo_date($forum['last_post_date']) ?>

Layout 3 forum.php

<?php wpforo_date($topic['modified']); ?>

Layout 4 forum-thread.php

<?php echo $thread['last_post_date'] ?>
Reply
adriaan
Posts: 47
Topic starter
(@adriaan)
Eminent Member
Joined: 2 years ago

Thanks! Now it worked 🙂

Can i also the time zone? would like to have it with 24h 🙂

Reply
2 Replies
Tutrix
(@tutrix)
Joined: 2 years ago

Prominent Member
Posts: 669

@adriaan 

you have to do this via wordpress settings > Formatting Date and Time

Reply
Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9262

@adriaan,

The time zone is a user specific option. All users can change their time zones in Their Profile > Account page, so the topics and posts dates will be displayed according to their time-zone. You can change it for your account as well:

Reply
adriaan
Posts: 47
Topic starter
(@adriaan)
Eminent Member
Joined: 2 years ago

Hello,

I have already set the time format correctly (H: i) but it still shows me the pm and am format in the forum

Reply
6 Replies
Tutrix
(@tutrix)
Joined: 2 years ago

Prominent Member
Posts: 669

@adriaan 

try (G:i)

or

use

, 'd/m/Y h:i a'
Reply
adriaan
(@adriaan)
Joined: 2 years ago

Eminent Member
Posts: 47

@tutrix Hello

Unfortunately, none of this changes anything
I use this code and have also changed the settings in WordPress

Code:

<div class="wpforo-last-topic-date"><?php wpforo_date($topic['modified'], 'd/m/Y h:i a'); ?></div>

WordPress Settings are visible on the screenshot

Reply
Tutrix
(@tutrix)
Joined: 2 years ago

Prominent Member
Posts: 669

@adriaan 

remove the "a"

, 'd/m/Y h:i'

or

, 'd/m/Y g:i'

which country and time zone are you?

Reply
adriaan
(@adriaan)
Joined: 2 years ago

Eminent Member
Posts: 47

@tutrix 

Now it looks better 🙂 But "am & pm" is still displayed in the forum topics
example:
http://www.igl-home.de/community/anabas-ctenopoma-microctenopoma-sandelia/ctenopoma-acutirostre-2/#post-40671

Our Timezone is Europe/Berlin

Reply
Tutrix
(@tutrix)
Joined: 2 years ago

Prominent Member
Posts: 669

@adriaan 

why is your wordpress english although you have a german site

normally you should have the same settings as me

Reply
adriaan
(@adriaan)
Joined: 2 years ago

Eminent Member
Posts: 47

@tutrix The language of the site is set to German - in the admin area I only set it in English for myself

Reply
adriaan
Posts: 47
Topic starter
(@adriaan)
Eminent Member
Joined: 2 years ago

The language of the site is set to German - in the admin area I only set it in English for myself

Reply
Share: