Notifications
Clear all

Add snippet of first post into forum list

17 Posts
3 Users
5 Likes
1,365 Views
Anonymous3542
Posts: 393
Topic starter
(@anonymous3542)
Reputable Member
Joined: 5 years ago

I'm looking at adding a snippet of the last post in the threaded layout view (main page), rather like the recent.php file. Is there a simple way to add this ?

Thanks

16 Replies
Robert
Posts: 9327
Admin
(@robert)
Support Team
Joined: 6 years ago

Hi anonymous3542,

As far as I understand you want to change the Recent Posts page layout with the threaded layout topic list. Am I correct?

Reply
4 Replies
Anonymous3542
(@anonymous3542)
Joined: 5 years ago

Reputable Member
Posts: 393

@robert no - what I'm looking for is the list of current topics per forum on the main page (Threaded layout), which currently has the topic title. I'd like to include some of the text from the post itself [body].

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

Support Team
Posts: 9327

I'm sorry but i don't follow you. It's already exist on home page under threaded layout forums. There are lists of recent topics under each category.

Reply
Anonymous3542
(@anonymous3542)
Joined: 5 years ago

Reputable Member
Posts: 393

@robert see my next posts.

Reply
Anonymous3542
(@anonymous3542)
Joined: 5 years ago

Reputable Member
Posts: 393

Recent topics, yes, but only the title ? I need the body

Reply
Anonymous3542
Posts: 393
Topic starter
(@anonymous3542)
Reputable Member
Joined: 5 years ago

Taking this from recent.php, so something similar that can be used on the main page in threaded view under the topic title

$last_post = wpforo_post($topic['last_post']);

Does this help ?

Reply
Anonymous3542
Posts: 393
Topic starter
(@anonymous3542)
Reputable Member
Joined: 5 years ago

Pretty close I think as there is an array here, but I need to know which branch contains the detail I need

<?php $last_post = wpforo_post($topic['last_post']); echo $last_post; ?>

Exploding the array

<?php $last_post = wpforo_post($topic['last_post']); print_r($last_post); ?>

Would indicate that

$topic['body'] 

contains that I want, but it doesn't seem to work ? The array itself returns

Array ( [postid] => 2079 [parentid] => 1990 [forumid] => 18 [topicid] => 135 [userid] => 1091 [title] => RE: Centralized authentication service suggestions [body] =>
Thanks! I haven't been able to get back on track with it. I appreciate the suggestions! I will have to find time and get back to it.

[created] => 2019-04-13 15:00:16 [modified] => 2019-04-13 15:00:16 [likes] => 0 [votes] => 0 [is_answer] => 0 [is_first_post] => 0 [status] => 0 [name] => [email] => [private] => 0 [root] => 1990 [url] =>  https://inocul8r.net/session/community/advice/centralized-authentication-service-suggestions/#post-2079  [is_answered] => 0 [votes_sum] => 0 [likes_count] => 0 [likers_usernames] => Array ( ) )
Reply
Anonymous3542
Posts: 393
Topic starter
(@anonymous3542)
Reputable Member
Joined: 5 years ago

Any thoughts, anyone ? @robert @sofy ?

Thanks

Reply
Page 1 / 2
Share: