Info
- 3 posts
- 2 voices
- Started 5 years ago by deeperstillwatersrun
- Latest reply from deeperstillwatersrun
- This topic is not a support question
Turning profile.php into a blog (sort of)
-
- Posted 5 years ago #
I'd like to change the profile page to look more like a blog, so I want to have the user's info on the left and the topics that they've started listed down the right complete with text and a link to the topic to read the comments (replies). Right now I'm stuck on how to show the text of the topic post. Here's what I've got so far:
<?php foreach ($threads as $topic) : ?>
<div class="post">
<h2 class="posttitle">
<a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>
</h2>
<p class="postmeta"><?php printf(__('posted %s ago'), get_topic_start_time()); ?>
<div class="the_content">
<?php post_text(); ?>
</div>
</div>
<?php endforeach; ?>
but post_text() just returns the text of the first topic for all the topics, instead of each topic showing the text that it's supposed to.
Thanks for any help...
(by topic, I mean the first post of a thread - just so we're clear) -
- Posted 5 years ago #
try this
<div class="the_content">
<?php $blogposts = get_thread( $topic->topic_id); ?>
<?php echo $blogposts[0]->post_text; ?>
</div> -
- Posted 5 years ago #
Worked great. Thanks a lot.
-
You must log in to post.