Forum Topic Loop
-
Hello there,
Firstly thank you for viewing this thread, really appreciate.
I am trying to create a topic loop to display in my in development theme. I have created a template part in my
theme-directory/bbpress/omna-forumthreads
see below:<?php /** * Single Thread * * @package bbPress * @subpackage Theme */ $threadURL = bbp_topic_permalink(); $threadTitle = bbp_topic_title(); $threadTIme = bbp_topic_post_date(); ///////////////// Thread Author Avatar URL //////////////////////// $user_id = bbp_get_user_id( $user_id ); $authorAvatarURL = get_avatar_url( $user_id, 300 ); /////////////////////////////////////////////////////////////////// $threadVoiceCount = bbp_topic_voice_count(); ?> <div class="swiper-slide-item"> <div class="icon-author" style="background-image: url('<?php echo $authorAvatarURL; ?>'); background-image: -webkit-image-set(url('<?php echo $authorAvatarURL; ?>') 1x, url('<?php echo $authorAvatarURL; ?>') 2x);"> </div><<?php echo $threadURL; ?>"><?php echo $threadTitle; ?></a></h2> <time class="data" datetime="<?php echo $threadTIme; ?>"><?php echo $threadTIme; ?></time> <span class="views"><i class="fa fa-comment-alt"></i><?php echo $threadVoiceCount; ?></span> </div> </div>
And i believe this should work, But currently i have issues with the loop that should display it by driving the content from the template part. Here is my loops:
<div class="swiper-wrapper"> <div class="swiper-slide"> <div class="swiper-slide-container"> <?php if ( bbp_has_topics() ): while ( bbp_topics() ) : bbp_the_topic(); bbp_get_template_part( 'bbpress/omna', 'forumthreads' ) endwhile; endif; ?> </div> </div> </div>
Now i get a pass error:
Parse error: syntax error, unexpected ‘endwhile’ (T_ENDWHILE) in C:\wamp\www\omna\wp-content\themes\omna\page-home.php on line 143
I have also tried the curly brace {} type of IF & WHILE expressions, still a parse error..
Please Help.
- You must be logged in to reply to this topic.