If you want a specific view to have images, you would need to create a custom view template called either single-view-recent-with-topic-image.php
or view-recent-with-topic-image.php
and most of the code would be based on the single-view.php
template in the extras folder in the bbPress plugin, you would have to make it custom enough to include the featured image code, and I guess however your users will be able to select a featured image during topic creation.
Thats a great help, Thanks! Would it be possible to call this new view in a shortcode?
The shortcode that you posted seemed alright with the code you posted, so you had the right ID and everything, only thing I would possibly say is if those quotes don’t work use single quotes.
'
Apologies for being unclear,
The shortcode I posted worked, just wondering if I create a new view template if I will be able to call it in a shortcode?
Thanks!
Creating a new view template will help with the layout of how you want it. And yes you can still show that view with a shortcode.
Continuing on….
In my themes function.php file I have the following which creates my thumbnail:
// /bbpress/templates/default/content-single-forum
add_action('bbp_template_before_single_forum', 'pym_print_featured_image_single_forum', 11);
add_action('bbp_template_before_single_forum', 'pym_print_forum_description', 12);
function pym_print_featured_image_single_forum() {
if (has_post_thumbnail()) {
echo '<div class="pym-bbp-topic-thumbnail">';
echo get_the_post_thumbnail(null, 'thumbnail' );
echo '</div>';
}
}
I have been calling this elsewhere in my template using ”
<?php do_action( 'bbp_template_before_single_forum' ); ?>
I am now trying to edit content-single-forum.php to call this thumbnail using the following:
<?php bbp_get_template_part( 'loop', 'topics' ); ?>
How do I go about getting the thumbnail to be called in the loop?
Thanks, Malcolm