Notifications
Clear all

Remove the post creation date from the RecentPost widget

2 Posts
2 Users
1 Likes
80 Views
CENTRAL4ALL
Posts: 498
Topic starter
(@central4allgmail-com)
Prominent Member
Joined: 4 years ago

How to remove the post creation date from the RecentTopics widget?
I found this code in the RecentTopics.php file:
esc_html( wpforo_date( $topic['created'], 'ago', false ) ) (line 94)
But removing it breaks the website

https://prnt.sc/qClJSzSrEcd-

1 Reply
Robert
Posts: 9912
Admin
(@robert)
Support Team
Joined: 7 years ago

@central4allgmail-com,

You should never make changes in the core files. This can be done by a small JS script:

jQuery('#wpf-widget-recent-replies .postuser').html(function(_,h){
    return h.replace(/\,.+?$/g,'');
});

 

If you don't have a place for a JS code, then you should put it directly in the footer.php of your WordPress active theme with <script> ... </script> wrapper:

<script>
   jQuery('#wpf-widget-recent-replies .postuser').html(function(_,h){
	return h.replace(/\,.+?$/g,'');
   });
</script>

 

 

 

Reply