Notifications
Clear all

wpForo 1.x.x [Closed] Date of last post

15 Posts
3 Users
4 Reactions
1,778 Views
Posts: 47
Topic starter
(@adriaan)
Trusted Member
Joined: 4 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: 1304
(@tutrix)
Noble Member
Joined: 4 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') ?>
2 Replies
(@adriaan)
Joined: 4 years ago

Trusted Member
Posts: 47

@tutrix 

i cant find the line

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

Noble Member
Posts: 1304

@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'] ?>
Posts: 47
Topic starter
(@adriaan)
Trusted Member
Joined: 4 years ago

Thanks! Now it worked 🙂

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

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

Noble Member
Posts: 1304

@adriaan 

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

Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10523

@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:

Posts: 47
Topic starter
(@adriaan)
Trusted Member
Joined: 4 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

6 Replies
Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1304

@adriaan 

try (G:i)

or

use

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

Trusted 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

Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1304

@adriaan 

remove the "a"

, 'd/m/Y h:i'

or

, 'd/m/Y g:i'

which country and time zone are you?

(@adriaan)
Joined: 4 years ago

Trusted 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

Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1304

@adriaan 

why is your wordpress english although you have a german site

normally you should have the same settings as me

(@adriaan)
Joined: 4 years ago

Trusted 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

Posts: 47
Topic starter
(@adriaan)
Trusted Member
Joined: 4 years ago

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